Symptoms: when building for Cypress FX2 chip (8051 compatible), firmware working or not working randomly, depending on linking order. Disassembling with IDA reveals that some functions from CSEG may be placed at address 0x0000, if they are short enough to feat before address 0x43, which is used for USB interrupts. The bug is that interrupt vectors are defined in "HOME" area, which MUST be placed at address 0x0000 with highest priority. Please, fix that. In current versions of SDCC (I tried 3.4.0-win32 and 3.3.0-win32) the linker can place CSEG before HOME. I've found a temporary solution by relocating CSEG with command -Wl-bCSEG=0x0080, wasting half of a day for that... And this fix works only until some other code section appears in source files.
Any additional information by request.
Log in to post a comment.