> Am 18.02.2018 um 07:50 schrieb Georg Icking-Konert: >> hello all, >> >> following a discussion on the updated STM8 SPL license (see >> https://github.com/gicking/STM8-SPL_SDCC_patch/issues/1 ) I happened to >> notice something strange: >> >> 1) build example including all SPL modules, where a pin toggles every >> 500ms >> >> Â Â Â - code adress range is 0x8000 to 0x1000c, i.e. >16-bit address >> range >> >> Â Â Â - according to map file, the topmost function starts at 0xFFE3, >> i.e. >> within 16bit address range >> >> Â Â Â -> code works as expected >> >> 2) build example including all SPL modules, where byte is sent via UART >> every 500ms >> >> Â Â Â - code adress range is 0x8000 to 0x10009, i.e. >16-bit address >> range >> >> Â Â Â - according to map file, the topmost function starts at 0xFFE0, >> i.e. >> within 16bit address range >> >> Â Â Â -> code works as expected >> >> 3) add pin toggling from 1) to 2) >> >> Â Â Â - code adress range is 0x8000 to 0x1002c, i.e. >16-bit address >> range >> >> Â Â Â - according to map file, the topmost function starts at 0x10003, >> i.e. outside 16bit address range >> >> Â Â Â -> no pin toggle, no UART output >> >> >> I am using SDCC 3.6.0 #9615 (Linux) >> >> It appears to me as if code with function start addresses >16b fail, >> while relative calls inside functions can exceed the 16b address >> range...? >> >> Is this just a mistake on my side (e.g. missing SDCC parameter), a known >> limitation, or a bug? I know that the 8051 (w/o long calls) works around >> this using code banking. From hardware side this is not required on the >> STM8, but what about SDCC (coming from 8051)...? >> >> For your feedback thanks a lot in advance! >> >> Regards, >> Georg > > This is a known limitation. Currently, SDCC only supports 16-bit > adresses for STM8, both for data and code. In particular, support for a > larger memory model that uses 24-bit addresses for code or data is not > yet implemented. > Implementing support for 24-bit code addresses wouldn't be that hard. > Implementing support for 24-bit data addresses would be more complicated. > > Philipp
Do I understand correctly that your STM8 has code memory above 0xFFFF? So the problem is that SDCC only generates 16 bit jump/call instructions and thus cannot reach 0x10000 and above, but it can 'overflow' into that area. Does the STM8 have separate 24 bit jump/call instructions? Or is it a special mode like on the DS390? Or is one supposed to use bank switching? And are there also STM8 versions with only memory below 64k? I get the feeling SDCC for STM8 will need a memory model option to target these two situations. Maarten ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user