Open VilNeo opened 11 months ago
My suspicion here is that this is either an RTT or defmt bug. Those parts of the code use the memory definition to read or write some data. The main probe-rs code does not really care about the RAM, it only needs a small amount while flashing, but this doesn't matter when the firmware is running.
Have you tried changing the target file to use only a single, larger RAM region, and does that solve your issue?
The target configuration file is auto-generated, so the RAM is probably just not specified in the file that ST provides. Adding the correct region there should solve your problem.
Cause for this bug seems to be:
The read_c_string
function only reads the string if it's located in a known memory region:
This function is used to retrieve the name of the RTT channel, but it fails because the string is not in a known memory region.
The name of the channel is used to determine the format, but because retrieving it failed, the channel is assumed to use the String
data format.
Because of this, the code tries to interpret the defmt
data as a String
, which fails.
Thank you very much. Indeed, I remember, that the RTT channel was not named properly. Adding another RAM-entry fixed the problem.
I will add the missing entries within the next days.
Thank you for your help!
probe-run places a canary on the stack which triggers this. We could do the same.
Good point. In fact, the canary check in probe-run gave me the hint, that the wrong defmt output may be related to the probe-rs target definitions. I will try to consider this in my future PR as well.
I will take care of the canary feature in a dedicated PR.
Thanks a lot!
Describe the bug
Hello,
many (every?) STM32L4 devices provide two SRAM regions (SRAM1 and SRAM2) which can be accessed from 0x20000000 continuously. This makes it possible to use e.g. 64k for STM32L432KCU or 40k for STM32L412KBU.
Unfortunately, with the commit the available SRAM regions switched from (SRAM1+SRAM2) to just SRAM1.
This may lead to some problems:
To Reproduce Steps to reproduce the behavior:
stm32l4 = {version="0.15.1", features = ["stm32l4x2"]}
orstm32l4xx-hal = {version = "0.7", features = ["stm32l432"]}
Expected behavior
Desktop (please complete the following information):
Of course, I could change them as well resulting in a pull request. But I would like to have the previously mentioned points discussed beforehand.
Thank you very much and best regards Alex