Closed dolfandringa closed 3 years ago
Issues are only used to report bugs
Try posting your question https://www.stm32duino.com
I already did without any luck. Why are you sure this isn't a bug? By looking at the stm32 arduino core (the other core and its low power library), I think I am doing everything right. So I am wondering if there isn't an issue with this core and stop mode. Maybe a clock doesn't get set properly? Or there is an issue with interrupts somewhere?
Its hard to know whether this is bug in the USART Class or your code.
I'll leave this issue open. But there are no actively developers on this core.
You are better off using the official core if this core does not do what you want or has bugs
Thanks for the help. Yeah, I am kind of feeling that too. It's hard to find good info on the difference between the cores and how they relate to each other. When I had to decide, people were saying that for the STM32F1 series specifically, this one was more mature. And by now, I have a bunch of code (including unittests) that is based on your core. So switching is going to be a pain now.
This core was developed about 12 years ago by LeafLabs or their "Maple" board, which used the STM32F1. At that time, third party cores were not supported by the Arduino IDE, so LeafLabs wrote a customised version of the IDE which included their core.
However by 2015 they had abandoned their IDE / Core, but by that time, the Arduino IDE stated to support 3rd party external cores, and Bob Cousins did the initial port of the Maple core to the bare bones of this core.
Bob abandoned his initial conversion, a few months after he created it, and I took it over..
But it 2018/19 STM developed their own core, which uses the STM32 Cube/ HAL as its internal API.
I'm quite surprised this core is still as active as it is, considering there are no active devs on it and STM now fully support their own core.
The example you posted in the forum is different from this one. Here you are mixing USB serial (Serial) with USART1 (Serial1).
I think you should initialize Serial1 before using usart_putc(USART1, 0x61);
Closed due to inactivity, also the forum query is also not active.
I am trying to implement the low power sleep, deepsleep (=stop) and standby modes using the libmaple core and builtin RTClock library. I am succeeding but am having an issue where the USART1 port stops working after waking up. Checking the hex output from the serial monitor, I do see data is being sent, but it just sends 3 NULL bytes per character, instead of the actual characters. And using a debugger I can see the
wakeup
function is getting called and the device does wake up (led starts blinking again). So it is definitely a usart issue. I triedSerial.flush()
andSerial.end()
before sleeping andSerial.begin
when waking up again, but to no avail. I feel it is something to do with clock sources, and/or data being stuck in the buffer somewhere? But I can't seem to fix it. Any suggestions?And as a side node, I'd be happy to contribute my code as a proper PR/library to the libmaple core once it works if you're interested.
This is my code: