lpcware

LPC1769 flash, memory mapping

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by inspire on Fri Mar 15 12:36:24 MST 2013
Hi,

I'm trying to write some bytes to the flash memory of the LPC1769 but this always fails with the message "SRC_ADDR_NOT_MAPPED".

The test code is:


uint32_t test = 123456;

printf("prepare: %u\n", u32IAP_PrepareSectors(16, 16));
printf("written: %u\n", u32IAP_CopyRAMToFlash(0x00010000, (uint32_t) test, 256));


and the functions


uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector)
{
    uint32_t u32Status;
    uint32_t au32Result[5];
    uint32_t au32Command[5];

    if (u32EndSector < u32StartSector)
    {
        u32Status = IAP_STA_INVALD_PARAM;
    }
    else
    {
        au32Command[0] = IAP_CMD_PREPARE_SECTORS;
        au32Command[1] = u32StartSector;
        au32Command[2] = u32EndSector;

        IAP_EXECUTE_CMD(au32Command, au32Result);

        u32Status = au32Result[0];
    }
    return u32Status;
}

uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len)
{
    uint32_t au32Result[5];
    uint32_t au32Command[5];

    au32Command[0] = IAP_CMD_COPY_RAM_TO_FLASH;
    au32Command[1] = u32DstAddr;
    au32Command[2] = u32SrcAddr;
    au32Command[3] = u32Len;
    au32Command[4] = SystemCoreClock / 1000UL;    /* Core clock frequency in kHz */

    IAP_EXECUTE_CMD(au32Command, au32Result);

    return au32Result[0];
}


what does this SRC_ADDR_NOT_MAPPED mean?

thanks!
inspire

Outcomes