Hi Basil,attached please find the project with output. Maybe you find something. File "main_RAM.ihx" was manually created by removing all lines in "main.ihx" with address in flash.
I tested this with a Sduino Uno board (https://github.com/roybaer/sduino_uno) and used stm8gal for uploading and subsequent jump to 0xa0 (in RAM). Unfortunately I have no experience with ucSim, so I can't really comment on what your finding means.
However, if acc. to ucSim the code should be working, but it doesn't on actual hardware, maybe it's because of the GO command in ROM bootloader? Specifically: normally the GO target address is 0x8000, which AFAIK triggers a reset. This is quite different from jumping to a user function directly. And RAM doesn't make it easier as it doesn't survive a possible reset. Does anyone have more information what the "GO" command in the bootloader actually does?
In any case thanks a lot for your support! Have a great day :-) Georg Am 23.11.20 um 23:25 schrieb Basil Hussain:
However, even when I correct the jump address from main.map the LED doesn't blink. Then I included the delay loop into main() to avoid function calls altogether (->main now at 0xa0), but still no blinking. Darn!Hmm, if that's the case now, hard to say.I don't have STM8 hardware on hand right now, but I ran your code from the original message in ucSim, telling it to break upon writes to PC_ODR (0x500A), and start execution from PC 0xD7 (main). It churns away and does what is expected, breaking at regular intervals. So, it appears at least the code does what is expected.Are you sure you don't have a hardware problem? Is your LED hooked up correctly? (Although, given your use of PC5, I would guess you have an ST Nucleo board, because that's where they connect the 'user' on-board LED.)Can you post the assembly code that was output from compilation? Or maybe the Hex file?Regards, Basil Hussain _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user
blink_RAM.tar.gz
Description: application/gzip
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user