Stack Pointer goes to unknown location R5F100GE

Hello all,

Our Application is the High Voltage side. So we added some protecting TVS diodes and Resistors only,

We are using CS+ for CA,CX Software.

The program can be downloaded to the MCU and it runs also. but after some use, it goes on one memory location,

We have redesigned our PCB, In our old PCB, the same program is still working properly.

We redefined some data segments as below.





Our Memory Model type is Small Model(Code 64Bytes, Data 64Bytes)

Some times Stack Pointer stops at 0x1000 Location and some times it stops at 0xFFFF location.

Help me solve the problem. Thanks in Advance.

  • Good day, Unobtanium!

    How are things going for you? Do you have any progress on this? I hope you could wait for responses from experts regarding your inquiry. For the mean time, I found threads that might be useful to you.

    I hope that will help you a little.

    Best regards,
    RenesasRulz Forum Moderator

  • In reply to Sai:

    Thank you for your reply. any of these does not solve my problem. I can wait but not for much time. we have to do this faster as our customers are facing problems.

  • In reply to Sai:

    Just after disabling and then enabling flash access, I am facing a new problem.... while the emulator is connected to board stack pointer reaches a different location. And while the emulator is not connected to the board at the same place when the stack pointer goes to a different location, Here RESET occurs. and we don't get any bit high in RESF Register after RESET. Power to the board is given externally, which means not through EMULATOR. Thank you for your Help sai. But that won't work. Guide me.
  • In reply to Unobtanium:

    From your information it is not possible to find the reason for the problem.

    You said you redesigned the hardware. I assume you added some new functionality.

    You say the old software is still working fine. So the software for the new added functionality causes the problems.

    You mention the stack pointer is corrupted. It looks like the new software causes a memory corruption or you have a stack overflow modifying other data. It could be for example that with the new software you get bigger function nesting or interrupt nesting. This would require a bigger stack. If this is not provided the stack will overwrite data or data can modify the stack contents.

    It may also that memory access via pointers (e.g. for buffers) causes problems if the pointer exceeds the buffer size.

    When you use the debugger the stack size is different as the debugger requires additional bytes on the stack and the addresses cannot be compared directly.

  • In reply to FrankL:

    Thank you for you answer.
    Yes, we redesigned the hardware. But only protecting components added. There is nothing new in functionality.
    So the software is not Changed. same software works in the older design. But not working in NEW PCB. In most cases while reading ADC it goes to different location(0xd343),(0xFFFF),(0xF135). Program Counter shows this addresses after the program stops at these locations.