[SOLVED] LPC546xx: write Flash by page, not by sector

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] LPC546xx: write Flash by page, not by sector

    From what I've understood after reading User's Manual of LPC546xx MCUs by NXP, internal Flash is organized of uniform 32kB sectors and uniform 256B pages. There's a command to erase one or more sectors and there's a command to erase one or more pages (that must be all inside a sector).

    In my project I'd like to have a bootloader at the beginning of internal Flash with a size of 20kB. So the application should start at address 20480=0x5000.

    I'm using MCUXpresso IDE and I think I've configured everything well for both projects (bootloader and application). What happens when I launch Debug configuration of application project? I suspect JLink erases the entire first sector, so erasing bootloader too. Similar thing happens when I launch bootloader Debug configuration that erases the full first sector (so overwriting application, if any was written before).

    Is there any way to change the erase from a sector boundary to a page boundary?
  • Hi,
    This should help you out:
    wiki.segger.com/Read-Modify-Write_Flash

    BR
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.