This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IAP Firmware Update and KEIL ARM flash routines

Having stepped further in my IAP firmware update project I now want to flash sectors on a LPC1343. I decided to use the flash source code delivered with the KEIL MDK V4.23 (C:\Keil\ARM\Flash\LPC_IAP\FlashPrg.c).
I'm wondering about a function 'Init()' which switches the processors clock to the internal oscillator. As my bootloader app has already executed its startup code, my processsor is running from an external oscillator. So, why to switch to the internal osc before flashing?
Best regards, Juergen.

Parents
  • Ok, used the (modified) flash routines successfully.

    Now a strategic problem:
    Have the loader at 0x00000000 and the application at 0x00003000.
    Initial both are flashed by UV4.

    After power up the loader checks if the CRC of the application is correct and jumps to the application by setting VTOR and jumping to applications reset vector like this:
    SCB->VTOR = (0x00003000 & 0x1FFFFF80);
    p = (unsigned *)(0x00003000 + 4);
    mainapp_entry = (void *) *p;
    mainapp_entry();

    Problem is the check that the applications CRC is ok (e.g. that further IAP flashing went ok).

    Therefore want to move the application to 0x00003010 (or higher), to get (at least) 16 bytes room (0x00003000..0x0000300F) for
    - uint32_t BIN filesize
    - uint32_t CRC
    - uint32_t Inv CRC
    - uint32_t Reserve
    So I have these info at same (fixed) addresses.

    This way my IAP master can extend the bin file by these four dwords and the loader starts flashing at a sector boundary (0x00003000).

    Question:
    Is it ok to locate the application at a 16 byte boundary (0x00003010), set VTOR to a 16 byte boundary (0x00003010) and jump to 0x00003010+4?

Reply
  • Ok, used the (modified) flash routines successfully.

    Now a strategic problem:
    Have the loader at 0x00000000 and the application at 0x00003000.
    Initial both are flashed by UV4.

    After power up the loader checks if the CRC of the application is correct and jumps to the application by setting VTOR and jumping to applications reset vector like this:
    SCB->VTOR = (0x00003000 & 0x1FFFFF80);
    p = (unsigned *)(0x00003000 + 4);
    mainapp_entry = (void *) *p;
    mainapp_entry();

    Problem is the check that the applications CRC is ok (e.g. that further IAP flashing went ok).

    Therefore want to move the application to 0x00003010 (or higher), to get (at least) 16 bytes room (0x00003000..0x0000300F) for
    - uint32_t BIN filesize
    - uint32_t CRC
    - uint32_t Inv CRC
    - uint32_t Reserve
    So I have these info at same (fixed) addresses.

    This way my IAP master can extend the bin file by these four dwords and the loader starts flashing at a sector boundary (0x00003000).

    Question:
    Is it ok to locate the application at a 16 byte boundary (0x00003010), set VTOR to a 16 byte boundary (0x00003010) and jump to 0x00003010+4?

Children