RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
gserranowong
Posts: 3
Joined: Mon Aug 25, 2025 8:18 am
Been thanked: 1 time

RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init  Topic is solved

Postby gserranowong » Mon Aug 25, 2025 7:27 pm

Hi — thanks for your help in advance.

I am going through the demo for STM32F302R8 named RT-STM32F302R8 under demos/STM32/RT-STM32F302R8-NUCLEO64. However it’s not working with the defaults and I have not been able to make it work. I am using the latest master on branch but I also tried a commit from past in particular 7690f8434839bc5294d288d1fea5e9b5ff747766 which seems to be the first commit with the demo. I only tested the full example but stucked on the queue insertion.

Full example

Code: Select all

➜  RT-STM32F302R8-NUCLEO64 git:(master) ✗ arm-none-eabi-gdb build/ch.elf
GNU gdb (GNU Tools for STM32 13.3.rel1.20240926-1715) 14.2.90.20240526-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/ch.elf...
(gdb) load
You can't do that when your target is `exec'
(gdb) target
core             extended-remote  record-core      remote           
exec             record-btrace    record-full      tfile           
(gdb) target
core             extended-remote  record-core      remote           
exec             record-btrace    record-full      tfile           
(gdb) target extended-remote tcp:127.0.0.1:3333
Remote debugging using tcp:127.0.0.1:3333
ch_pqueue_insert_behind (p=0x20002054 <ch0+68>, pqp=0x20002010 <ch0>)
    at ../../../os/rt/include/chlists.h:438
438       pqp = pqp->next;
(gdb) monitor reset halt
Unable to match requested speed 1000 kHz, using 950 kHz
Unable to match requested speed 1000 kHz, using 950 kHz
[stm32f3x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000278 msp: 0x20000400
(gdb) break main
Breakpoint 1 at 0x8009520: file main.c, line 41.
Note: automatically using hardware breakpoints for read-only addresses.
(gdb) continue
Continuing.

Breakpoint 1, main () at main.c:41
41   int main(void) {
(gdb) next
halted: PC: 0x08009522
halted: PC: 0x08009524
50     halInit();
(gdb) next
halted: PC: 0x08009526
halted: PC: 0x08009528
halted: PC: 0x0800952c
halted: PC: 0x0800952e
halted: PC: 0x08009530
halted: PC: 0x08009534
halted: PC: 0x08009536
halted: PC: 0x08009538
halted: PC: 0x0800953a
halted: PC: 0x0800953e
halted: PC: 0x08009540
halted: PC: 0x08009542
halted: PC: 0x08009544
halted: PC: 0x08009546
halted: PC: 0x08009548
halted: PC: 0x0800954a
halted: PC: 0x0800954c
halted: PC: 0x0800954e
halted: PC: 0x08009550
halted: PC: 0x08009552
halted: PC: 0x08009554
halted: PC: 0x08009558
halted: PC: 0x0800955a
halted: PC: 0x0800955c
halted: PC: 0x0800955e
halted: PC: 0x08009560
halted: PC: 0x08009564
halted: PC: 0x08009566
halted: PC: 0x08009568
halted: PC: 0x0800956c
halted: PC: 0x08009570
halted: PC: 0x0800957e
halted: PC: 0x08009580
halted: PC: 0x08009582
halted: PC: 0x08009586
halted: PC: 0x0800959a
halted: PC: 0x0800959c
halted: PC: 0x0800959e
halted: PC: 0x080002c0
halted: PC: 0x080095a4
halted: PC: 0x080095a6
halted: PC: 0x080002c0
halted: PC: 0x080095ac
halted: PC: 0x080095ae
halted: PC: 0x080002c0
halted: PC: 0x080095b4
halted: PC: 0x080095b6
halted: PC: 0x080002c0
halted: PC: 0x080095bc
halted: PC: 0x080095be
halted: PC: 0x080002c0
halted: PC: 0x080095c4
halted: PC: 0x080095c6
halted: PC: 0x080002c0
halted: PC: 0x080095cc
halted: PC: 0x080095ce
halted: PC: 0x080002c0
halted: PC: 0x080095d4
halted: PC: 0x080095d6
halted: PC: 0x080095da
halted: PC: 0x080095dc
halted: PC: 0x080095de
halted: PC: 0x080095e0
halted: PC: 0x080095e2
halted: PC: 0x080095e6
halted: PC: 0x080095e8
halted: PC: 0x080095ea
halted: PC: 0x080095ec
halted: PC: 0x080095ee
halted: PC: 0x080095f2
halted: PC: 0x080095f4
halted: PC: 0x080095f6
halted: PC: 0x080095f8
halted: PC: 0x080095fc
halted: PC: 0x080095fe
halted: PC: 0x08009600
halted: PC: 0x08009602
halted: PC: 0x08009604
halted: PC: 0x08009606
halted: PC: 0x08009608
halted: PC: 0x0800960a
halted: PC: 0x0800960c
halted: PC: 0x0800960e
halted: PC: 0x08009610
halted: PC: 0x08009612
halted: PC: 0x08009614
halted: PC: 0x08009618
halted: PC: 0x0800961a
halted: PC: 0x0800961c
halted: PC: 0x0800961e
halted: PC: 0x08009620
halted: PC: 0x08009622
halted: PC: 0x08009624
halted: PC: 0x08009626
halted: PC: 0x08009628
halted: PC: 0x0800962a
halted: PC: 0x0800962c
halted: PC: 0x0800962e
halted: PC: 0x08009630
halted: PC: 0x08009632
halted: PC: 0x08009634
halted: PC: 0x08009636
halted: PC: 0x08009638
halted: PC: 0x0800963a
halted: PC: 0x0800963c
halted: PC: 0x0800963e
halted: PC: 0x080002c0
halted: PC: 0x08009644
halted: PC: 0x08009646
halted: PC: 0x08009648
halted: PC: 0x0800964a
halted: PC: 0x0800964c
halted: PC: 0x0800964e
halted: PC: 0x08009650
halted: PC: 0x08009652
halted: PC: 0x08009656
halted: PC: 0x0800965a
halted: PC: 0x0800965c
halted: PC: 0x08009660
halted: PC: 0x08009662
halted: PC: 0x08009664
halted: PC: 0x08009666
halted: PC: 0x08009668
halted: PC: 0x0800966a
halted: PC: 0x0800966c
halted: PC: 0x0800966e
halted: PC: 0x08009670
halted: PC: 0x08009672
halted: PC: 0x080002c0
51     chSysInit();
(gdb) next
halted: PC: 0x08009678
halted: PC: 0x0800967a
halted: PC: 0x0800967c
halted: PC: 0x0800967e
halted: PC: 0x08009680
halted: PC: 0x08009682
halted: PC: 0x08009684
halted: PC: 0x08009686
halted: PC: 0x08009688
halted: PC: 0x0800968c
halted: PC: 0x0800968e
halted: PC: 0x08009690
halted: PC: 0x08000500
halted: PC: 0x08009696
halted: PC: 0x08000510
halted: PC: 0x0800969c
halted: PC: 0x0800968e
halted: PC: 0x08009690
halted: PC: 0x08000500
halted: PC: 0x08009696
halted: PC: 0x08000510
halted: PC: 0x0800969c
halted: PC: 0x0800968e
halted: PC: 0x08009690
halted: PC: 0x08000500
halted: PC: 0x08009696
halted: PC: 0x08000510
halted: PC: 0x0800969c
halted: PC: 0x0800968e
halted: PC: 0x08009690
halted: PC: 0x08000500
halted: PC: 0x08009696
halted: PC: 0x08000510
halted: PC: 0x0800969c
halted: PC: 0x0800969e
halted: PC: 0x080096a0
halted: PC: 0x080096a2
halted: PC: 0x080096a4
halted: PC: 0x080096a6
halted: PC: 0x080096a8
halted: PC: 0x080096aa
halted: PC: 0x080096ac
halted: PC: 0x080096ae
halted: PC: 0x080096b0
halted: PC: 0x080096b2
halted: PC: 0x080096b4
halted: PC: 0x080096b6
halted: PC: 0x080096b8
halted: PC: 0x080096ba
halted: PC: 0x080096bc
halted: PC: 0x080096be
halted: PC: 0x080096c0
halted: PC: 0x080096c4
halted: PC: 0x080096c6
halted: PC: 0x080096c8
halted: PC: 0x080096ca
halted: PC: 0x080096cc
halted: PC: 0x080096ce
halted: PC: 0x080096d0
halted: PC: 0x080096d2
halted: PC: 0x080096d6
halted: PC: 0x080096d8
halted: PC: 0x080096da
halted: PC: 0x080096dc
halted: PC: 0x080096de
halted: PC: 0x080096e0
halted: PC: 0x080096e2
halted: PC: 0x080096e4
halted: PC: 0x080096e6
halted: PC: 0x080096ea
halted: PC: 0x080096ec
halted: PC: 0x080096f0
halted: PC: 0x080096f2
halted: PC: 0x080096f4
halted: PC: 0x080096f6
halted: PC: 0x080096f8
halted: PC: 0x080096fa
halted: PC: 0x080096fc
halted: PC: 0x08009700
halted: PC: 0x08009702
halted: PC: 0x08009706
halted: PC: 0x08009708
halted: PC: 0x0800970c
halted: PC: 0x0800970e
halted: PC: 0x08009710
halted: PC: 0x08009712
halted: PC: 0x08009714
halted: PC: 0x08009716
halted: PC: 0x08009718
halted: PC: 0x0800971a
halted: PC: 0x0800971e
halted: PC: 0x08009720
halted: PC: 0x08009722
halted: PC: 0x08009724
halted: PC: 0x08009728
halted: PC: 0x0800972a
halted: PC: 0x0800972c
halted: PC: 0x0800972e
halted: PC: 0x08009730
halted: PC: 0x08009732
halted: PC: 0x08009736
halted: PC: 0x0800973a
halted: PC: 0x0800973e
halted: PC: 0x08009740
halted: PC: 0x08009742
halted: PC: 0x08009746
halted: PC: 0x08009748
halted: PC: 0x0800974a
halted: PC: 0x0800974c
halted: PC: 0x08009750
halted: PC: 0x08009752
halted: PC: 0x08009754
halted: PC: 0x08009756
halted: PC: 0x0800975a
halted: PC: 0x0800975e
halted: PC: 0x08009762
halted: PC: 0x08009764
halted: PC: 0x08009768
halted: PC: 0x0800976a
halted: PC: 0x0800976c
halted: PC: 0x08009770
halted: PC: 0x08009772
halted: PC: 0x08009774
halted: PC: 0x08009778
halted: PC: 0x0800977c
halted: PC: 0x08009780
halted: PC: 0x08009782
halted: PC: 0x08009784
halted: PC: 0x08009786
halted: PC: 0x0800978a
halted: PC: 0x0800978e
halted: PC: 0x08009790
halted: PC: 0x08009792
halted: PC: 0x08009794
halted: PC: 0x08009796
halted: PC: 0x08009798
halted: PC: 0x0800979a
halted: PC: 0x0800979c
halted: PC: 0x0800979e
halted: PC: 0x080097a0
halted: PC: 0x080097a2
halted: PC: 0x080097a6
halted: PC: 0x08000430
halted: PC: 0x080097ac
halted: PC: 0x080097b0
halted: PC: 0x080097b4
halted: PC: 0x080097b6
halted: PC: 0x080097b8
halted: PC: 0x080097ba
halted: PC: 0x080097bc
halted: PC: 0x080097be
halted: PC: 0x080097c0
halted: PC: 0x08009830
halted: PC: 0x08009832
halted: PC: 0x08009834
halted: PC: 0x08009836
halted: PC: 0x08009838
halted: PC: 0x0800983a
halted: PC: 0x0800983e
halted: PC: 0x08009840
halted: PC: 0x08009842
halted: PC: 0x08009844
halted: PC: 0x08009846
halted: PC: 0x0800984a
halted: PC: 0x08000430
halted: PC: 0x08009850
halted: PC: 0x08009854
halted: PC: 0x08009856
halted: PC: 0x08009858
halted: PC: 0x0800985c
halted: PC: 0x0800985e
halted: PC: 0x08009860
halted: PC: 0x08009862
halted: PC: 0x08009864
halted: PC: 0x08009866
halted: PC: 0x08009868
halted: PC: 0x0800986c
halted: PC: 0x0800986e
halted: PC: 0x08009870
halted: PC: 0x08009872
halted: PC: 0x08009874
halted: PC: 0x08009876
halted: PC: 0x08009878
halted: PC: 0x080014c0
^C
Program received signal SIGINT, Interrupt.
0x0800144c in ch_pqueue_insert_behind (p=0x20002054 <ch0+68>, pqp=0x20002010 <ch0>)
    at ../../../os/rt/include/chlists.h:439
439     } while (unlikely(pqp->prio >= p->prio));
(gdb) p pqp->prio
$1 = 0
(gdb) p p->prio
$2 = 1
(gdb) disassemble ch_pqueue_insert_behind
Dump of assembler code for function __sch_ready_behind:
   0x08001440 <+0>:   movs   r3, #0
   0x08001442 <+2>:   strb   r3, [r0, #28]
   0x08001444 <+4>:   ldr   r3, [r0, #16]
   0x08001446 <+6>:   ldr   r1, [r0, #8]
   0x08001448 <+8>:   ldr   r3, [r3, #0]
   0x0800144a <+10>:   ldr   r2, [r3, #8]
=> 0x0800144c <+12>:   cmp   r2, r1
   0x0800144e <+14>:   bcc.n   0x8001448 <__sch_ready_behind+8>
   0x08001450 <+16>:   str   r3, [r0, #0]
   0x08001452 <+18>:   ldr   r2, [r3, #4]
   0x08001454 <+20>:   str   r2, [r0, #4]
   0x08001456 <+22>:   str   r0, [r2, #0]
   0x08001458 <+24>:   str   r0, [r3, #4]
   0x0800145a <+26>:   bx   lr
End of assembler dump.
(gdb) load


Here it cicles on ch_pqueue_insert_behind, not sure why because

Code: Select all

(unlikely(pqp->prio >= p->prio))
seems to be false.

without tests

Code: Select all

diff --git a/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c b/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
index 217736487..8a93eff7d 100644
--- a/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
+++ b/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
@@ -16,8 +16,6 @@
 
 #include "ch.h"
 #include "hal.h"
-#include "rt_test_root.h"
-#include "oslib_test_root.h"
 
 /*
  * Green LED blinker thread, times are in milliseconds.
@@ -50,14 +48,6 @@ int main(void) {
   halInit();
   chSysInit();
 
-  /*
-   * Activates the serial driver 2 using the driver default configuration.
-   */
-  sdStart(&SD2, NULL);
-
-  /*
-   * Creates the blinker thread.
-   */
   chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
 
   /*
@@ -65,10 +55,5 @@ int main(void) {
    * sleeping in a loop and check the button state.
    */
   while (true) {
-    if (!palReadPad(GPIOC, GPIOC_BUTTON)) {
-      test_execute((BaseSequentialStream *)&SD2, &rt_test_suite);
-      test_execute((BaseSequentialStream *)&SD2, &oslib_test_suite);
-    }
-    chThdSleepMilliseconds(500);
   }
}


Failing here.

Code: Select all

void chEvtObjectInit(event_source_t *esp) {

  chDbgCheck(esp != NULL);

  esp->next = (event_listener_t *)esp;
}


Code: Select all

(gdb) delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) break main
Breakpoint 2 at 0x80013d0: file main.c, line 41.
(gdb) continue
Continuing.

Breakpoint 2, main () at main.c:41
41   int main(void) {
(gdb) next
halted: PC: 0x080013d2
50     halInit();
(gdb) next
halted: PC: 0x080013d4
halted: PC: 0x080013d6
halted: PC: 0x080013da
halted: PC: 0x080013dc
halted: PC: 0x080013de
halted: PC: 0x080013e2
halted: PC: 0x080013e4
halted: PC: 0x080013e6
halted: PC: 0x080013e8
halted: PC: 0x080013ec
halted: PC: 0x080013ee
halted: PC: 0x080013f0
halted: PC: 0x080013f2
halted: PC: 0x080013f4
halted: PC: 0x080013f6
halted: PC: 0x080013f8
halted: PC: 0x080013fa
halted: PC: 0x080013fc
halted: PC: 0x080013fe
halted: PC: 0x08001400
halted: PC: 0x08001402
halted: PC: 0x08001406
halted: PC: 0x08001408
halted: PC: 0x0800140a
halted: PC: 0x0800140c
halted: PC: 0x0800140e
halted: PC: 0x08001412
halted: PC: 0x08001414
halted: PC: 0x08001416
halted: PC: 0x0800141a
halted: PC: 0x0800141e
halted: PC: 0x0800142c
halted: PC: 0x0800142e
halted: PC: 0x08001430
halted: PC: 0x08001434
halted: PC: 0x08001448
halted: PC: 0x0800144a
halted: PC: 0x0800144c
halted: PC: 0x08000440
halted: PC: 0x08001452
halted: PC: 0x08001454
halted: PC: 0x08000440
halted: PC: 0x0800145a
halted: PC: 0x0800145c
halted: PC: 0x08000440
halted: PC: 0x08001462
halted: PC: 0x08001464
halted: PC: 0x08000440
halted: PC: 0x0800146a
halted: PC: 0x0800146c
halted: PC: 0x08000440
halted: PC: 0x08001472
halted: PC: 0x08001474
halted: PC: 0x08000440
halted: PC: 0x0800147a
halted: PC: 0x0800147c
halted: PC: 0x08000440
halted: PC: 0x08001482
halted: PC: 0x08001484
halted: PC: 0x08001488
halted: PC: 0x0800148a
halted: PC: 0x0800148c
halted: PC: 0x0800148e
halted: PC: 0x08001490
halted: PC: 0x08001494
halted: PC: 0x08001496
halted: PC: 0x08001498
halted: PC: 0x0800149a
halted: PC: 0x0800149c
halted: PC: 0x080014a0
halted: PC: 0x08001390
^C
Program received signal SIGINT, Interrupt.
chSysHalt (reason=reason@entry=0x800159c <__func__.10.lto_priv.1> "chEvtObjectInit")
    at ../../../os/rt/src/chsys.c:218
218     while (true) {
(gdb) bt
#0  chSysHalt (reason=reason@entry=0x800159c <__func__.10.lto_priv.1> "chEvtObjectInit")
    at ../../../os/rt/src/chsys.c:218
#1  0x0800139a in chEvtObjectInit (esp=<optimized out>) at ../../../os/rt/src/chevents.c:101
#2  0x080014a4 in osalEventObjectInit (esp=<optimized out>) at ../../../os/hal/osal/rt-nil/osal.h:934
#3  sdObjectInit (sdp=<optimized out>) at ../../../os/hal/src/hal_serial.c:169
#4  sd_lld_init () at ../../../os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c:614
#5  sdInit () at ../../../os/hal/src/hal_serial.c:136
#6  halInit () at ../../../os/hal/src/hal.c:105
#7  main () at main.c:50
(gdb) bt full
#0  chSysHalt (reason=reason@entry=0x800159c <__func__.10.lto_priv.1> "chEvtObjectInit")
    at ../../../os/rt/src/chsys.c:218
No locals.
#1  0x0800139a in chEvtObjectInit (esp=<optimized out>) at ../../../os/rt/src/chevents.c:101
        __func__ = "chEvtObjectInit"
#2  0x080014a4 in osalEventObjectInit (esp=<optimized out>) at ../../../os/hal/osal/rt-nil/osal.h:934
No locals.
#3  sdObjectInit (sdp=<optimized out>) at ../../../os/hal/src/hal_serial.c:169
No locals.
#4  sd_lld_init () at ../../../os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c:614
No locals.
#5  sdInit () at ../../../os/hal/src/hal_serial.c:136
No locals.
#6  halInit () at ../../../os/hal/src/hal.c:105
No locals.
#7  main () at main.c:50


Without serial enabled

Diff

Code: Select all

Last login: Mon Aug 25 10:23:28 on ttys012
➜  RT-STM32F302R8-NUCLEO64 git:(master) ✗ pwd
/Users/gserranowong/src/ChibiOS/demos/STM32/RT-STM32F302R8-NUCLEO64
➜  RT-STM32F302R8-NUCLEO64 git:(master) ✗ git diff
➜  RT-STM32F302R8-NUCLEO64 git:(master) ✗ git diff

























































@@ -142,7 +142,7 @@
  * @brief   Enables the SERIAL subsystem.
  */
 #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL                      TRUE
+#define HAL_USE_SERIAL                      FALSE
 #endif
 
 /**
uconf.h
index 563496491..a1b77dbdd 100644
--- a/demos/STM32/RT-STM32F302R8-NUCLEO64/cfg/mcuconf.h
+++ b/demos/STM32/RT-STM32F302R8-NUCLEO64/cfg/mcuconf.h
@@ -193,7 +193,7 @@
  * SERIAL driver system settings.
  */
 #define STM32_SERIAL_USE_USART1             FALSE
-#define STM32_SERIAL_USE_USART2             TRUE
+#define STM32_SERIAL_USE_USART2             FALSE
 #define STM32_SERIAL_USE_USART3             FALSE
 #define STM32_SERIAL_USE_UART4              FALSE
 #define STM32_SERIAL_USE_UART5              FALSE
diff --git a/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c b/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
index 217736487..8a93eff7d 100644
--- a/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
+++ b/demos/STM32/RT-STM32F302R8-NUCLEO64/main.c
@@ -16,8 +16,6 @@
 
 #include "ch.h"
 #include "hal.h"
-#include "rt_test_root.h"
-#include "oslib_test_root.h"
 
 /*
  * Green LED blinker thread, times are in milliseconds.
@@ -50,14 +48,6 @@ int main(void) {
   halInit();
   chSysInit();
 
-  /*
-   * Activates the serial driver 2 using the driver default configuration.
-   */
-  sdStart(&SD2, NULL);
-
-  /*
-   * Creates the blinker thread.
-   */
   chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
 
   /*
@@ -65,10 +55,5 @@ int main(void) {
    * sleeping in a loop and check the button state.
    */
   while (true) {
-    if (!palReadPad(GPIOC, GPIOC_BUTTON)) {
-      test_execute((BaseSequentialStream *)&SD2, &rt_test_suite);
-      test_execute((BaseSequentialStream *)&SD2, &oslib_test_suite);
-    }
-    chThdSleepMilliseconds(500);
   }
 }


Debugger

Code: Select all

gdb) Breakpoint 5, main () at main.c:39
39      int main(void) {
(gdb) next
halted: PC: 0x080011e2
halted: PC: 0x080011e4
48        halInit();
(gdb) next
halted: PC: 0x08000670
^C
Program received signal SIGINT, Interrupt.
chSysHalt (reason=reason@entry=0x800132c <__func__.0.lto_priv.0> "st_lld_init")
    at ../../../os/rt/src/chsys.c:218
218       while (true) {
(gdb) bt
#0  chSysHalt (reason=reason@entry=0x800132c <__func__.0.lto_priv.0> "st_lld_init")
    at ../../../os/rt/src/chsys.c:218
#1  0x0800065a in st_lld_init () at ../../../os/hal/ports/STM32/LLD/SYSTICKv1/hal_st_lld.c:595
#2  0x08000668 in stInit () at ../../../os/hal/src/hal_st.c:77
#3  0x0800067c in halInit () at ../../../os/hal/src/hal.c:156
#4  0x080011e8 in main () at main.c:48


The problem seems to be

Code: Select all

/*===========================================================================*/
/* Driver exported functions.                                                */
/*===========================================================================*/

/**
 * @brief   Low level ST driver initialization.
 *
 * @notapi
 */
void st_lld_init(void) {

#if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
  /* Free running counter mode.*/
  osalDbgAssert((ST_CLOCK_SRC % OSAL_ST_FREQUENCY) == 0U,
                "clock rounding error");
 
 


I have tried by disabling this section of code but it just leads me to linker errors due to undefined symbols, etc..

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init

Postby Giovanni » Mon Aug 25, 2025 7:40 pm

Hi,

Which version are you using?

Giovanni

gserranowong
Posts: 3
Joined: Mon Aug 25, 2025 8:18 am
Been thanked: 1 time

Re: RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init

Postby gserranowong » Mon Aug 25, 2025 7:57 pm

from release_note_next.txt

RT 7.0.0

OS Library 1.3.0

SB 1.1.0

NIL 4.1.0

HAL 7.2.0

I also tested with OS Library 1.3.0

Plus I tested with two boards so it seems its not the board. First time working on chibiOS so sorry if this doesnt anwser your question.

Gleiry

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init

Postby Giovanni » Mon Aug 25, 2025 8:18 pm

It does not seem very up to date, do you mind downloading version 21.11.3 and give it a try?

BTW the release number is in /os/license/chversion.h

Giovanni

gserranowong
Posts: 3
Joined: Mon Aug 25, 2025 8:18 am
Been thanked: 1 time

Re: RT-STM32F302R8 demo on NUCLEO‑F302R8 halts during init

Postby gserranowong » Mon Aug 25, 2025 9:38 pm

Yes, I can confirm that was the issue. I was pulling from master and the version is the old version. Not sure if this is stated somewhere but its a bit misleading because it has recent pushes, so I assumed that was the version to use. Thanks for your help!


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 92 guests