Open akuker opened 4 months ago
Oh yes, you are right, thanks for the hint! It doesn't work on my current computer (SDCC v4.0.0) either. I will have to investigate a bit when I find the time. Until then, the precompiled binary should at least work.
Splitting up usb_host seemed to help: https://github.com/wagiminator/Development-Boards/compare/main...akuker:Development-Boards:main
I also made some updates to the makefile to put the build files in an obj
directory and added auto-include functionality.
@wagiminator - would you like a PR with these changes?
Strange! If it works, then you can make a PR.
Trying to understand why it works. I spot checked the generated assembly, and it looks the same. But in the .map file, different amounts of CSEC memory are being allocated when all functions are in the same file. I don't have my board with me, but I'll do a bunch more testing this weekend before I submit a PR.
Issue
The current CH554E_HostDevBoard doesn't fit in memory when its compiled as-is.
When the example is built on Ubuntu 22 with sdcc 4.2.0 using the
make
command, the following output is observed:This is similar to the issue reported on the ch554_sdcc project: https://github.com/Blinkinlabs/ch554_sdcc/issues/48
Workaround
As a temporary work-around, the
define printf printf_tiny
line can be enabled ininclude/debug.h
. However, this stripped down version of printf appears to just dump the string without formatting.Another thing that reduced the amount of flash used was to add the
--nogcse
option to theCFLAGS
list in the makefile. However, this change alone did not shrink the code enough to fit in the ch554e. Reference: https://sdcc-user.narkive.com/2CPmObSg/emergency-help-linker-memory-error-with-dseg