CS32F103 freezes on libmaple RTC codes

Anything not related to STM32
Post Reply
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

CS32F103 freezes on libmaple RTC codes

Post by ag123 »

hi,

while I'm working something off a 'clone' deemed 'cs32f103 blue pill' board, the looked like 'blue pills' with the genuine chip, but with instead a cs32f103.

while trying out codes in the RTCAdjust
https://github.com/rogerclarkmelbourne/ ... /RTCAdjust
as it turns out that code freezes on startup, quite interestingly it is able to get past the freeze and continue running as my led blinks after a long stall (minutes).

If I switched to a real 'maple mini (clone)' with a real stm32f103cbt6, everything runs perfect, no freezes, the RTC clock runs as expected.

My thoughts are that there could be a few reason:
- LSE did not start on the 'clone' cs32f103 pill board - most likely (but I did not bother to find out). They placed a module that looked like one of those 'epson' 32k modules.
- the RTC implementation is after all different

if indeed it is the latter, i.e. different RTC implementation, then it is quite possible that the chip is after all reverse engineered.
but as I did not check if the 1st reason can be ruled out i.e. LSE not running, we can't conclude the 2nd reason to be likely.

as it is able to get past the stall, my guess is, it is more than likely it is simply due to LSE not running.
Last edited by ag123 on Wed Jul 05, 2023 5:56 pm, edited 3 times in total.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: CS32F103 freezes on libmaple RTC codes

Post by ag123 »

I did a test by swtiching the codes to use LSI, it stalls, the same.
This eliminates the notion that LSE - the 32k crystal is not oscillating.

While another genuine stm32f103cbt6 runs ok on LSI, no issues.

now it seemed fairly likely that the RTC implementation is after all different.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: CS32F103 freezes on libmaple RTC codes

Post by ag123 »

ok so they are after all different, even in the decapped die photos
https://www.usenix.org/system/files/woo ... rmaier.pdf
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: CS32F103 freezes on libmaple RTC codes

Post by dannyf »

it turns out that code freezes on startup,
maybe you put a stlink on it to see where it freezes up. sounds more like a while loop timing out thing than an actual freeze, as your code seems to be executing.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: CS32F103 freezes on libmaple RTC codes

Post by ag123 »

well, in addition, the CS32F103 (or CKS32F103) RTC produce a nil result i.e. it always stay at epoch 0, while STM32F103 is counting time whether be it LSE or LSI. Hence, the RTC is at least different.
Post Reply

Return to “Off topic”