Closed FredPraca closed 4 years ago
Ok, which branch should I now use ? Still community-2020 ?
Yes, you have to rebase since there are new patches on this branch now.
We have new source template system in place and this PR will benefit from using it.
For a file to be handled as a template, it just needs to have a
.tmpl
extension. For instancememory-map.ld.tmpl
. And template configuration values are added using theadd_template_config_value()
function. For instance in cortexm.py:
FYI the current template system on the community-2020
branch (at commit 3d1542e at the time of writing) doesn't work properly with linker script files (e.g. memory-map.ld.tmpl
files) due to a bug where the template config values aren't passed to the generator for linker script files. It works fine with Ada source files though.
I've already made a fix for this in #44, but this hasn't been merged yet. The relevant patch to fix this in support/bsp_sources/archsupport.py
can be found in commit 4c5e438.
Well at the moment, I ported it similarly to what's done with other boards but compilation fails with a strange error when using _python3 build_rts.py --build --verbose --force --output=/opt/gnat-2020-arm-elf/arm-eabi/lib/gnat nucleof411re command line:
building project /opt/gnat-2020-arm-elf/arm-eabi/lib/gnat/zfp-nucleo_f411re/runtime_build.gpr
Setup
[mkdir] object directory for project Runtime_Build
[mkdir] library directory for project Runtime_Build
Compile
[Asm_Cpp] start-ram.S
[Asm_Cpp] start-rom.S
[Asm_Cpp] breakpoint_handler-cortexm.S
[Asm_Cpp] start-common.S
[Ada] s-stm32.ads
[Ada] i-stm32-usart.ads
cannot generate code for file s-stm32.ads (package spec)
compilation of s-stm32.ads failed
Any advice welcomed, I've been struggling too long with this port.
I think that error occurs when you try to build a package spec (.ads file). It sounds like the s-stm32.adb
file has not been copied by the runtime.
I looked at the code in your nucleo_f411re
branch and I think that s-stm32.adb
is not being copied into the generated runtime.
The problem seems to be in the configuration in cortexm.py
. On line 691 you set self.mcu
to 'stm32f411'
, but then later on line 731 you compare it against 'stm32f411re'
which has an re
on the end. This means that s-stm32.adb
is never added to the gnat sources. If you fix that mismatch then I think the error you're seeing will go away.
Thanks Daniel ! I'll try this but I'm confident that's the problem. I think it was a bit late when I've done it :smile:
Hello @FredPraca ,
We have new source template system in place and this PR will benefit from using it.
For a file to be handled as a template, it just needs to have a
.tmpl
extension. For instancememory-map.ld.tmpl
. And template configuration values are added using theadd_template_config_value()
function. For instance in cortexm.py:See:
I'll let you change the code accordingly and open a new PR.