hello again,
I did a few more tests and it seems like ROM bootloader and stm8gal
function properly. Here is what I did:
1) program a "fast blink" program to 0x8000 (checked in map and ihx file)
2) compile/link a "slow blink" for 0x9000 (checked in map and ihx file)
3) manually removed lines below 0x9000 from main.ihx, including "jmp
0x9000"
4) using stm8gal in same session
a) upload "slow blink" hexfile without prior flash erase
b) "GO to 0x9000" --> LED blinks slowly
5) press reset button --> LED blinks fast
6) using stm8gal "GO to 0x9000" (no upload) --> LED blinks slowly
So I can indeed jump to different programs in flash using stm8gal and
the BL GO command. So, at least for flash addresses, stm8gal and the ROM
bootloader work as expected, e.g. no reset triggered. Now I'm running
out of ideas... :-(
Regards, Georg
Am 24.11.20 um 17:58 schrieb Georg Icking-Konert:
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
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user