This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSPM0G3507: LP-MSPM0G3507

Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: MSPM0L2228

Tool/software:

Hi evrybody.

I am trying to reach to a bootmanager-bootloader-application system.

Bootmanager shall start after reset and decide if the bootloader ar the application shall have the controll after that.

If there is no need for the application change (i.e. no bootloader will be involved), a jump to application shall be made. Otherwise, it shall jump to bootloader.

For this purpose I have have used 2 empty examples. The first one (that i call it bootmanager), is using the provided linker file for gcc environment, and is performin a jump at the adress 0x7000 (where the "application" will be stored). (This jump works, since when I use a function placed via linker at 0x7000, i stepp inside the function - this is just for testing the "jumping" to the proper adress)

Now, in the next step, the "bootmanager" contain only the jump (and the initialization of the MCU provided by example)

The second empty example is linked at adress 0x7000.

after a mass erase, I flash the "bootmanager", and i check the memory. At adress 0x0 it looks ok

In the same time at 0x7000 it is still empty.

Atter I flashh the "application" (i do it via "Load program"):  ,

i've got a lot of errors:

 

I clear the error via the Reset script:

the device is in the reset handler:

and I inspect the memory.

At address 0x7000 looks Ok:

but it look that at address 0x0 it was changed/overwritten:

Any ideeas, why this is hapenning? How can I solve this?

Many thanks,

Ovi

  • Hi Ovi,

    Have you taken a look at the boot image manager example, found under [SDK install path]\mspm0_sdk_2_01_00_03\examples\nortos\LP_MSPM0L2228\boot_manager, along with its documentation, found at [SDK Install Path]mspm0_sdk_2_01_00_03/docs/english/middleware/boot_manager/doc_guide/doc_guide-srcs/index.html ?

    This example is for the M0Lx22x device, but much of the process is the same, and the documentation will walk you through loading a boot manager application into a certain region of memory, with the intended application image in another region of memory. You can use this portion as a guide and example for your own project.

    I am not 100% clear on your process, but it sounds that you perform a mass erase, then flash the bootmanager code, and then observe that location 0x7000 is empty (which sounds like correct behavior). Then you attempt to flash the second image file using the same process, and get the error, but once you reconnect you find that the second image flashed correctly, and the first has been erased.

    To me it just seems that you should not be hitting the generic "load program" button for both images, as this indicates to CCS that you want to load only this one program to the device, which will clear the rest of the memory. So in this case you are erasing address 0x0-0x6FFF, which is clearing the reset vector and stack pointer without rewriting them, then causing the error condition. 

    You can see in the document I mention above that CCS has a "load memory" feature available when you open a debug session that will allow you to write to a region of memory without erasing the rest of the memory or affecting your original program. As an alternative you can try editing your project properties to prevent the debugger from erasing the memory when you flash the device.

  • Hi Dylan,

    thanks for answer. I have checked the documentaion that you pointed out. I am using Theia and gcc compiler. 

    The "load Memory" option from the documentation:

    looks somehow different from what I am experiencing:

    I take that the "Load Memory" would be the marked arrow in the build above, but nevertheles, I have (or I have not found) the option for specifieng the address where to load. So only what is metioned in hex is considerend.

    Now, erasing the flash:

    I have tried all the variants here:

    and i still did not succeded.

    Here is how the map file looks for the application:

    nevertheless, the "bootmanager" is erased, after "loading" the hex file for appl.

    What I am doing wrong?

    Thanks,

    Ovi

  • After looking into this a bit, I am seeing that the .map file specifies the address location of the data, so when selecting intel hex format you will not be given an option to choose the load address. On a related note, the .map file that you are loading in here likely specifies that the other memory location is cleared, so when you load this .map file to the device, this region of memory is cleared.

    One option here is to combine the .map file to include your boot manager binary and your application binary, so when you load the .map file to the device both are correctly placed in memory.

    Your other option, that will resemble the operations performed in that document I recommended, is to create separate .bin files for the boot manager and application. Then when you select the .bin format you will be asked to specify the load address for the boot manager and the application. You'll also need to make sure that you specify the erase configuration (that you mention above) is set to only erase the necessary sectors.