TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320C6455: TMS320C6455平台编写的 RC28F640J3D nor flash擦除程序不起作用。

Part Number:TMS320C6455

目前在ccs5.2上编写的RC28F640J3D nor flash擦除程序不起作用,帮忙看看哪里出了问题呢?

/* Flash address definitions */
#define DSK6455_FLASH_BASE (Uint32)0xB0000000 // CE3
#define DSK6455_FLASH_SECTORSIZE (Uint32)0x020000
#define DSK6455_FLASH_SECTORS (Uint32)0x40
#define DSK6455_FLASH_PAGES (Uint32)0x1
#define DSK6455_FLASH_PAGESIZE (Uint32)0x800000
#define DSK6455_FLASH_SIZE (Uint32)0x800000
#define DSK6455_FLASH_CTL555 (Uint32)(DSK6455_FLASH_BASE + 0x555)
#define DSK6455_FLASH_CTLAAA (Uint32)(DSK6455_FLASH_BASE + 0xaaa)
#define DSK6455_FLASH_SUPPORT 1
/* Calculate the checksum of a data range in Flash */
Uint32 DSK6455_FLASH_checksum(Uint32 start, Uint32 length);
/* Constant table containing end address of each sector */
static Uint32 sector_end[DSK6455_FLASH_SECTORS] = {
DSK6455_FLASH_BASE + 0x01ffff, /* Sector 1 */
DSK6455_FLASH_BASE + 0x03ffff, /* Sector 2 */
DSK6455_FLASH_BASE + 0x05ffff, /* Sector 3 */
DSK6455_FLASH_BASE + 0x07ffff, /* Sector 4 */
DSK6455_FLASH_BASE + 0x09ffff, /* Sector 5 */
DSK6455_FLASH_BASE + 0x0bffff, /* Sector 6 */
DSK6455_FLASH_BASE + 0x0dffff, /* Sector 7 */
DSK6455_FLASH_BASE + 0x0fffff, /* Sector 8 */
DSK6455_FLASH_BASE + 0x11ffff, /* Sector 9 */
DSK6455_FLASH_BASE + 0x13ffff, /* Sector 10 */
DSK6455_FLASH_BASE + 0x15ffff, /* Sector 11 */
DSK6455_FLASH_BASE + 0x17ffff, /* Sector 12 */
DSK6455_FLASH_BASE + 0x19ffff, /* Sector 13 */
DSK6455_FLASH_BASE + 0x1bffff, /* Sector 14 */
DSK6455_FLASH_BASE + 0x1dffff, /* Sector 15 */
DSK6455_FLASH_BASE + 0x1fffff, /* Sector 16 */
DSK6455_FLASH_BASE + 0x21ffff, /* Sector 17 */
DSK6455_FLASH_BASE + 0x23ffff, /* Sector 18 */
DSK6455_FLASH_BASE + 0x25ffff, /* Sector 19 */
DSK6455_FLASH_BASE + 0x27ffff, /* Sector 20 */
DSK6455_FLASH_BASE + 0x29ffff, /* Sector 21 */
DSK6455_FLASH_BASE + 0x2bffff, /* Sector 22 */
DSK6455_FLASH_BASE + 0x2dffff, /* Sector 23 */
DSK6455_FLASH_BASE + 0x2fffff, /* Sector 24 */
DSK6455_FLASH_BASE + 0x31ffff, /* Sector 25 */
DSK6455_FLASH_BASE + 0x33ffff, /* Sector 26 */
DSK6455_FLASH_BASE + 0x35ffff, /* Sector 27 */
DSK6455_FLASH_BASE + 0x37ffff, /* Sector 28 */
DSK6455_FLASH_BASE + 0x39ffff, /* Sector 29 */
DSK6455_FLASH_BASE + 0x3bffff, /* Sector 30 */
DSK6455_FLASH_BASE + 0x3dffff, /* Sector 31 */
DSK6455_FLASH_BASE + 0x3fffff, /* Sector 32 */
DSK6455_FLASH_BASE + 0x41ffff, /* Sector 33 */
DSK6455_FLASH_BASE + 0x43ffff, /* Sector 34 */
DSK6455_FLASH_BASE + 0x45ffff, /* Sector 35 */
DSK6455_FLASH_BASE + 0x47ffff, /* Sector 36 */
DSK6455_FLASH_BASE + 0x49ffff, /* Sector 37 */
DSK6455_FLASH_BASE + 0x4bffff, /* Sector 38 */
DSK6455_FLASH_BASE + 0x4dffff, /* Sector 39 */
DSK6455_FLASH_BASE + 0x4fffff, /* Sector 40 */
DSK6455_FLASH_BASE + 0x51ffff, /* Sector 41 */
DSK6455_FLASH_BASE + 0x53ffff, /* Sector 42 */
DSK6455_FLASH_BASE + 0x55ffff, /* Sector 43 */
DSK6455_FLASH_BASE + 0x57ffff, /* Sector 44 */
DSK6455_FLASH_BASE + 0x59ffff, /* Sector 45 */
DSK6455_FLASH_BASE + 0x5bffff, /* Sector 46 */
DSK6455_FLASH_BASE + 0x5dffff, /* Sector 47 */
DSK6455_FLASH_BASE + 0x5fffff, /* Sector 48 */
DSK6455_FLASH_BASE + 0x61ffff, /* Sector 49 */
DSK6455_FLASH_BASE + 0x63ffff, /* Sector 50 */
DSK6455_FLASH_BASE + 0x65ffff, /* Sector 51 */
DSK6455_FLASH_BASE + 0x67ffff, /* Sector 52 */
DSK6455_FLASH_BASE + 0x69ffff, /* Sector 53 */
DSK6455_FLASH_BASE + 0x6bffff, /* Sector 54 */
DSK6455_FLASH_BASE + 0x6dffff, /* Sector 55 */
DSK6455_FLASH_BASE + 0x6fffff, /* Sector 56 */
DSK6455_FLASH_BASE + 0x71ffff, /* Sector 57 */
DSK6455_FLASH_BASE + 0x73ffff, /* Sector 58 */
DSK6455_FLASH_BASE + 0x75ffff, /* Sector 59 */
DSK6455_FLASH_BASE + 0x77ffff, /* Sector 60 */
DSK6455_FLASH_BASE + 0x79ffff, /* Sector 61 */
DSK6455_FLASH_BASE + 0x7bffff, /* Sector 62 */
DSK6455_FLASH_BASE + 0x7dffff, /* Sector 63 */
DSK6455_FLASH_BASE + 0x7fffff /* Sector 64 */
};

/* Erase a segment of Flash memory */
void DSK6455_FLASH_erase()
{
Int16 i;
Uint8 *pdata;
Uint32 sector_base, end;
/* Calculate extents of range to erase */
end = DSK6455_FLASH_BASE + 0x800000 – 1;
sector_base = DSK6455_FLASH_BASE;
for (i = 0; i < DSK6455_FLASH_SECTORS; i++)
{
if ( ( ( sector_base >= DSK6455_FLASH_BASE ) || ( sector_end[i] >= DSK6455_FLASH_BASE ) ) &&
( ( sector_base <= end ) || ( sector_end[i] <= end ) ) )
{

  • pdata = (Uint8 *)sector_base;
    *pdata = 0x20;
    *pdata = 0xd0;//这两个是按照规格书command bus operation'写的
    while (1)
    if (*pdata & 0x80) //读status register,断点打出来*pdata值是0xB0
    {
    *pdata = 0xFF;//进入read array mode
    break;
    }
    }
    /* Advance to next sector */
    sector_base = sector_end[i] + 1;
    }
    }
Nancy Wang:

请问是否有通过示波器看一下擦除指令是否发出去了?最好抓波形看一下。

,

wang yanping:

工程里找到了有个flash擦除和写的代码,我试了可以正常擦除和烧写。

另外必须转成bin才能写进flash吗?能否转成ais的out文件,或者在release版本下的out文件。

,

Nancy Wang:

您说的ais是TMS320c674x中使用的,每个型号要求是不同的。

6.2.2.3 Creating the Boot Table

www.ti.com.cn/…/spruec6g.pdf

,

wang yanping:

我们用的TMS3206455,刷机调用的是代码里自带的flash擦除和写的函数,所以需要转换为bin格式的吧?hex是flashburn用的。能告诉下post build里的转换out为bin命令是什么吗?

,

Nancy Wang:

试一下以下指令:

“${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin” “${BuildArtifactFileName}” “${BuildArtifactFileBaseName}.bin” “${CG_TOOL_ROOT}/bin/ofd2000” “${CG_TOOL_ROOT}/bin/hex2000” “${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin”

Be sure to replace ofd2000 and hex2000 with the respective binaries for your device, for example, ofd6x and hex6x (for c6000) or armofd and armhex (for ARM).

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C6455: TMS320C6455平台编写的 RC28F640J3D nor flash擦除程序不起作用。
分享到: 更多 (0)