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.

CCS/SEGGER: Trouble writing memory block while starting a debug session

Part Number: SEGGER
Other Parts Discussed in Thread: AM3357

Tool/software: Code Composer Studio

Hello,

I try to debug a user specific bootloader application wirh Segger J-Link and Code Composer Studio v8 on a user specific hardware with a Sitara AM3357. Unfortunately I am not able to start the debug session because the load process stops with the following error:

CortxA8: Trouble Writing Memory Block at 0x40308064 on Page 0 of Length 0x2de0: Flash download failed! ...

CortxA8: File Loader: Verification failed: Target failed to write 0x40308064

CortxA8: GEL: File: :...... Load failed.

According the Sitara reference manual the mentioned address is part of the memory area L3 OCMC0 (0x4030_0000 - 0x4030_FFFF). I checked the GEL-file. The specified memory regions are correct. This boootloader application has been programmed some years ago with Code Composer Studio v6. Using this version the debug session works fine but the following note appears in the console:

CortxA8: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.


Does anybody know how to solve this problem? Thank you.

Regards, Marc


  • Marc,

    Indeed the memory range you mentioned is part of the OCMC0 region and should be writable.

    In general, these errors happen when there is something else going on with the device itself. Check the section "Available Target Memroy" of the Troubleshooting page below. It contains a few useful details to isolate and diagnose memory issues.

    http://dev.ti.com/tirex/explore/node?node=AO9-GVPz3wXEI7jRhKws0Q__FUz-xrs__LATEST 

    One additional scenario may be the fact the device is pre-initialized or has code running previously and therefore this memory may be somehow blocked by MMU or something else. You can check the MMU status at the bottom right of the main CCS view. 

    Apart from this, I can't really think about any additional issues short of having some sort of bug on Segger's protocol and stack. 

    Hope this helps,

    Rafael

  • Rafael,

    thanks for the answer.

    I checked MMU status. The MMU is switched off.

    One of my collegue has the same behaviour on his machine. Using CCSv8 the described error occurs. There is no memory error using the same binary on CCSv6. In addition we are able to debug the application with a Lauterbach.

    I've looked into the debug section of the troubleshooting page. There is neither a connectivity issue on different boards.

    Because we have the same behaviour on different machines I don't think it is solved by deleting any cache files or launch files, etc.

    Regards, Marc

  • Marc, 

    Interesting, the Jlink software stack that is shipped with CCSv6 is obviously quite different than the one in CCSv8. With this in mind, I can't help but wonder if there is some sort of incompatibility between the newer software stack and the J-Link Software iand Documentation Pack nstalled in the hosts (available here). 

    I have in my Windows 10 1809 their version 6.30f, which is not the latest but it works well here. Perhaps that could be something to try?

    I will try some different hosts and see if I can reproduce this issue, but apart from this I can't pinpoint an exact root cause for this, therefore it is possible that you have to also contact Segger's support line.

    https://www.segger.com/support/technical-support/  

    Regards,

    Rafael

  • Rafael,

    in the meantime I got in touch with SEGGER and it seems to be an issue related to CCS or a wrong configuration in CCS. The same application that crashes with CCSv8 and the SEGGER J-Link is working with their debugger Ozone.

    I set up the bootloader application from the starterware without any modifcations. I can start the debug session using the AM335x ICE EVM Rev2.1 but there appears a warning in the consiole:

    CortxA8: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.

    Using a SEGGER instead of the embedded XDS100V2 USB emulation interface leads to the error I described in my first post. In this case the debug session Interrupts during the load process.

    Regards,

    Marc