Closed erazor-de closed 1 year ago
Addendum: The svd also defines interrupt 22 double and svd2nim puts this twice in the enum. Maybe using a set like container should help making the entries unique.
Another one: The base address of FSMC peripheral is at 0xa0000000. This gets translated to
type FSMC_BCR1_Type = object
loc: uint
const FSMC* = FSMC_Type(
BCR1: FSMC_BCR1_Type(loc: 0xa0000000),
The compiler complains Error: type mismatch: got 'int64' for '0x00000000A0000000'i64' but expected 'uint'
. Maybe a cast to unsigned would help.
I'm still a noob with nim that's why I'm not attempting a pull request. I uploaded the unmodified svd as txt because svd is not supported by github: STM32F103.txt
Hey, just noticed this issue. Thanks for pointing out this stuff, I haven't tested on many SVD files so far. I'll have a look, most of what you pointed out shouldn't be too hard to fix.
See : #3
There's a few other things I want to add/check before merging, but you can try the branch right away, it should produce (at least) a valid nim file. Let me know if you find other issues.
I have the manufacturers svd for a STM32F103 here and I have 2 issues:
The svd defines a register named
LOAD_
which is obviously a typo. The problem is that svd2nim creates an invalid object member which is also used in procedures but the type itself is created with only one underscore:Error message from the compiler:
Error: invalid token: trailing underscore
. The invalid chars need to be filtered out consistently.Also the svd is full of multi-line descriptions like
svd2nim ignores most descriptions, but the ones for interrupts are converted to normal comments
Which does not work. These should be converted to multi-line comments or the newlines filtered out.