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.

Unable to write to flash from CCS/nowFlash

Hello,

I believe I've recently introduced a bug into my code.  When I try to reprogram a board running my firmware, it gives me the following output in CCS:

CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0CortexR4: Flash Programmer: Error erasing Flash memory.

CortexR4: Flash Programmer: Error erasing Bank 0, Sector 0. Operation Cancelled.

CortexR4: Trouble Writing Memory Block at 0x0 on Page 0 of Length 0x20 

CortexR4: Warning: (Error -1003 @ 0x2BC5) Internal error: Invalid parameter passed to function. Restart the application. If error persists, please report the error. (Release 5.0.429.0) 

Cannot write to target

nowFlash gives me a similar error, about not being able to write memory at 0x0; I believe it gives me error 142.  Notably, it seems to erase the first page just fine; it just can't write.  I can also connect to these systems with JTAG, and have used this to verify the following:

Running from a valid clock source: either oscillator or FMzPLL at a valid setting, with CSVSTAT and CSDIS set appropriately.

CPSR is 0x600003D3 in one example: irq/fiq masked (I & F), in supervisor mode (M), endian bit (E) set, imprecise aborts disabled (A).

Running this on a fresh processor works fine, but then trying to reprogram it fails.  I've managed to recover the processors by using nRST, or occasionally a lot of power cycling and system reset/cpu reset from the debug menu.

I believe something about my processor state is causing the F035 functions to fail and I could use some help narrowing down what could be causing the problem.

I'm using a TMS570LS10106SPGE with CCS 4.2.4.00033.  I have a valid target configuration.  I'm using a blackhawk XDS100v2 jtag emulator.

Thanks,

Tom

  • Can you check the ESM registers? Expecially group 2, and 3. And when you connect with CCS, where do the PC stop?

    You can try to set a hardware breakpoint at address 0, then press nRST, then, MCU will stop at zero address. After that, try to erase the flash using the CCS embeded tools

    Regards,

    Haixiao

  • If I try programming from inside the IDE, the PC starts at 0 and ends at 0 after programming fails.  If I try from nowFlash and it fails, and then connect with the debugger, it's stuck in a deadloop at 0x08000730 (containing instruction b 0x08000730).  For reference, RAM starts at 0x08000000, so this is 0x730 bytes past the start of RAM.

    In both cases, ESM shows no outstanding errors.  Stat1, Stat2, and Stat3 all read as 0x0.

  • I can use nRST to reprogram a bricked processor successfully, but this happens to me several times a day and I need a permanent solution to avoid this problem.

  • I'm currently encountering a related variant where it erases 0x00000 to 0x18000, then fails to erase 0x18000.  If I reset it in a debugger (system reset + cpu reset), it will alternate between failing at 0x18000 and 0x1A000.

    This happens in nowFlash even when I take validated PLL settings from the datasheet table 7-2 for PLLCTL1 and PLLCTL2.

    Is there anything else I should be checking?  This is an extremely high priority for me to fix.

    Thanks,

    Tom

  • Can you upload your CCS project that cause such a problem?

    At lease, please post the .out file so that I can reproduce your problem.

    Regards,

    Haixiao

  • Hello Haixiao,

    Using the nowFlash "enable debug info" checkbox, I was able to determine that with a certain processor configuration VccP was going out of bounds; the 3.3V error bit was set in the status register.  We've since fixed the problem in hardware.  It was hard to find because regular nowFlash as well as the Code Composer flash plugin don't report this error, but we shouldn't have any more problems.

    Thanks,

    Tom