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.

MSP432E401Y: change load and start address in debug configuration

Part Number: MSP432E401Y
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

How can I change the CCS debug configuration of my target in a way that the program will be loaded and executed from a specific flash memory address which in my case is 0x00040000?

The respective settinsg in the cmd and the cfg file have already been done.

Thank you and regards
Peter

  • Hi Peter,

      See below example. 

    1. Click the "Manage Configuration" to add a new configuration. I just name it My_Run_Address_At_0x40000

    2. Once the My_Run_Address_At_0x40000 configuration is created, Click the "Set Active" to make it an active configuration. 

    3. Now you can add anything (e.g. files, project settings, your specific linker cmd) that is specific to this configuration. 

    4. Let's say you have two files called foo1.c and fool2.c. You can make foo1.c for Debug configuration but not foo2.c. In this case, in Debug configuration, you would exclude foo2.c from build. On contrary, you would exclude foo1.c in My_Run_Address_At_0x40000 configuration. 

  • Hi Charles,

    Thank you for your quick reply. However, my question was not on how to create additional build configurations but how to set a different start address in the debug configuration.

    So if you have set
    #define APP_BASE 0x00040000
    in the cmd file and
    m3Hwi.resetVectorAddress = 0x00040000;
    in the cfg file, how can you just upload the binary to 0x00040000 when pushing the debug button without having to compile, load by UniFlash, and then connect manually through the debugger?

    I have read that somewhere in the Debug Configuration dialog there should be an option to specify the addresses for "Load Symbols and Program" and for "Set PC to entry point" but I cannot find such options.

    So to summarize, where can I set the start vector address for the application in the debug configuration of my project?

    Regards
    Peter

  • in the cfg file, how can you just upload the binary to 0x00040000 when pushing the debug button without having to compile, load by UniFlash, and then connect manually through the debugger?

    I have read that somewhere in the Debug Configuration dialog there should be an option to specify the addresses for "Load Symbols and Program" and for "Set PC to entry point" but I cannot find such options.

    Are you saying the binary image is already built by perhaps another means (e.g. using Uniflash) and you have loaded a .out file to the flash? If the image starts at 0x40000, then the programmer (e.g. using Uniflash) will load the image to flash at 0x40000. If you later open CCS, you can just load the symbols and specify the .out fie to load. CCS will not reflash but rather only the symbols. Not sure if this is your question. The .out file has all the symbols information and annotate starting at 0x40000. 

    If you wrote a program that starts 0x40000 and you simply just want to click the "Debug" button then it will do compile, connect to the target, load the program. Again, if the binary image has already been programmed in the past, you don't want to click the "Debug" button but rather just load the symbols, you can just do "Load Symbols" under Run. Of course, I assume you already manually connected to the target. 

    Bear in mind that you cannot have just your binary starting at 0x40000 without anything at 0x0. You must at least have a Stack Pointer and Reset vector defined at 0x0 and 0x4. The CPU will start at 0x0 after reset. If there is nothing at 0x0, the program will crash. 

  • Hi Charles,

    In a production environment, we have a bootloader at 0x0 which will load the actual firmware at 0x00040000.

    For development, we usually load the debug firmware to 0x0 to be able to do uploiad and execution directly within CCS while the release target uses 0x00040000 as start vector.

    We now have a situation where we have an issue which only occurs if the firmware operates from 0x00040000 which is why we would debug the firmware from that position. My hope was that there is a way to tell the debugger to load the firmware to that desired address and to automatically set the jump to there wheren the program starts.

    If this is not possible, if I upload the bootloader to 0x0 via UniFlash, how to do tell the CCS debugger to upload its bin to 0x00040000 and not to overwrite the memory area below?

    Regards
    Peter

  • In a production environment, we have a bootloader at 0x0 which will load the actual firmware at 0x00040000.

    ok.

    If this is not possible, if I upload the bootloader to 0x0 via UniFlash, how to do tell the CCS debugger to upload its bin to 0x00040000 and not to overwrite the memory area below?

    See below example where I load boot_serial.bin (this is the bootloader starting at 0x0) and boot_demo1.bin (this is the application firmware) starting at 0x4000 simultaneously using JTAG. Once both binary are loaded, you can go to CCS and just do "Load Symbols" where you would specify boot_demo1.out (note this is the .out file) which contains the symbols. CCS will not reflash but only load the symbols. 

    It is possible to do all these inside CCS.

    1. Go to Tools->On-Chip Flash and select "Necessary Pages Only" for the Erase Method. This way the CCS will not erase the bootloader when you load your firmware starting at 0x40000. 

    2. First load your bootloader (e.g. boot_serial.out). Here I load the .out.  After flashing, you will see the bootloader starting at 0x0. 

    3. Next load your firmware (e.g. boot_demo1.out). Again, it is the .out that contains the symbols. After flashing, it will not erase the bootloader at 0x0. You can view the flash at 0x0 and the bootloader code should still be there.