radareorg / radare2-extras

Source graveyard and random candy for radare2
http://www.radare.org/
GNU Lesser General Public License v3.0
241 stars 116 forks source link

r2svd line break in SVD files gives errors #322

Closed AlexanderKrampe closed 1 year ago

AlexanderKrampe commented 1 year ago

Description

r2svd fails at recognizing line breaks in svd files (for example for the Syncronous and asynchronous receiver). In the correspdonig svd file there is a line break at this description. If you remove the line break the error is gone.

parsing_svd

trufae commented 1 year ago

Can you provide a reproducer or a fix? The code is quite small and easy to hack

AlexanderKrampe commented 1 year ago

I think r2svd should also set memory maps with 'om' and name them with 'omn' so that we have a complete memory map from the svd file. At the moment only flags or comments are added but no memory maps.

To reproduce just load blink.bin https://github.com/ghidraninja/arm-bare-metal-1/raw/master/blink.bin into r2 (r2 -w -n -m 0x08000000 blink.bin) and run r2svd in r2 with ".!r2svd STMicro STM32F446x.svd"

trufae commented 1 year ago

Yes that can be done but i would donthe maps when using a specific flag not by default

feel free to send a pr adapting it to your needs the code of r2svd is very easy to modify and tweak