I spent some time tinkering with a toolchain setup for SDCC and easypdkprog. You can find my work in progress here:
https://github.com/cpldcpu/SimPad/tree/master/ToolchainNotable findings:
Includes- I wrote a small python script that automatically generates include files from the CSV that JS posted a while ago. This should greatly reduce the work of creating include files for all MCUS. you can find it at
https://github.com/cpldcpu/SimPad/tree/master/Toolchain/util- The goal is currently to have one master "io.h" file that automatically includes the architecture specific files.
- The architecture specific includes contain information about i/o register locations. The descriptions of the individual bits seem to be universial for all devices and have therefore been moved into a common file.
- I also introduced F_CPU to allow for a proper delay function.
Makefile- Unversial makefile added, based on STM8-bare-min. Everything is automated now.
SDCC- I was pleasantly surprised to learn that SDCC can infer SET0/SET1 now. Therefore it is not necessary to introduce specific macros for set0/set1
- Since SDCC implements a very unusual way of defining SFRs, intellisense/vscode is not able to identify the register definitions. This is somewhat unfortunate. There is an open ticked about this at the vscode github since last year, but apparently it is not a priority. Is there any workaround? Doing it like AVR-GCC ("__sfr(register)") would allow using defines, which is more compatible to intellisense.
- It does not seem to be possible to use local labels in inline assembler? This is inconvenient because it does not allow inlining of functions with assembler code when they use labels...
- It appears the -p options is not yet supported for the PDK architecture? This would be very useful, because it would allow distinguishing different processors from the makefile. May use a define as a workaround for now...
Easypdkprog does not write the last byte of the ihx for some reason. This is only noticable when linking several files. Already submitted an issue.
I will add more examples soon. Also planning to integrates JS autocalibration code.
Let me know what you think. There are still many things to be clarified regarding naming etc.