Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVD file with identifiers containing "two consecutive underscores" #103

Open
photex opened this issue Mar 5, 2024 · 1 comment
Open

Comments

@photex
Copy link

photex commented Mar 5, 2024

Howdy!

I'm pretty new to all of this, so I'm not entirely certain where the fault here lies.

I have an SVD file for the SK32344 with which I'm attempting to build for this board: https://nxp.gitbook.io/mr-canhubk344/getting-started

I have built svd2ada, run it, things appear to be generated correctly. But when I try to build it with alr build I get an error in a particular file:

[chipc@sknkwrks s32k344_hal]$ alr build
ⓘ Building s32k344_hal/s32k344_hal.gpr...
Compile
   [Ada]          s32k344_svd-mu.ads
   [Ada]          s32k344_svd-flash.ads
   [Ada]          s32k344_svd-pmc.ads
   [Ada]          s32k344_svd-pll.ads
   [Ada]          s32k344_svd-mc_me.ads
   [Ada]          s32k344_svd-mc_cgm.ads
   [Ada]          s32k344_svd-fxosc.ads
   [Ada]          s32k344_svd-firc.ads
   [Ada]          s32k344_svd-sxosc.ads
   [Ada]          s32k344_svd-sirc.ads
   [Ada]          s32k344_svd-tspc.ads
   [Ada]          s32k344_svd-cmu_fm.ads
   [Ada]          s32k344_svd-cmu_fc.ads
   [Ada]          s32k344_svd-wkpu.ads
   [Ada]          s32k344_svd-dcm_gpr.ads
   [Ada]          s32k344_svd-dcm.ads
   [Ada]          s32k344_svd-virt_wrapper.ads
   [Ada]          s32k344_svd-siul2.ads
   [Ada]          s32k344_svd-mc_rgm.ads
   [Ada]          s32k344_svd-rtc.ads
s32k344_svd-mu.ads:729:35: error: two consecutive underlines not permitted
s32k344_svd-mu.ads:733:35: error: two consecutive underlines not permitted

   compilation of s32k344_svd-mu.ads failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/chipc/workspaces/kvs/external/libraries/NXP_S32K344/ada/s32k344_hal/s32k344_hal.gpr"] exited with code 4
error: Compilation failed.

The offending identifiers are:

   --  MUB
   MU_0_MUB_Periph : aliased MU_Peripheral
     with Import, Address => MU_0__MUB_Base;

   --  MUB
   MU_1_MUB_Periph : aliased MU_Peripheral
     with Import, Address => MU_1__MUB_Base;

In the SVD I have these lines:

[chipc@sknkwrks s32k344_hal]$ rg MU_.__MUB ~/workspaces/kvs/external/libraries/NXP_S32K344/S32K344_M7.svd
265619:      <name>MU_0__MUB</name>
269473:    <peripheral derivedFrom="MU_0__MUB">
269474:      <name>MU_1__MUB</name>

So, my question is whether the double underscores is something I can edit in the SVD file safely, or instead is there a flag I should be setting in the gpr project?

@photex
Copy link
Author

photex commented Mar 6, 2024

So, I removed one of the '_' in the generated source and it correctly resolved to a definition. Everything built, and I'll continue following along the blog post now.

I'm still unclear if it's safe to rename these in the svd file, but thankfully it's only the two items and I'll let this sleeping bear lie for a now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant