Skip to content

cpu/stm32: add support for U5 family#17410

Merged
benpicco merged 6 commits intoRIOT-OS:masterfrom
aabadie:pr/cpu/stm32u5
Jan 2, 2022
Merged

cpu/stm32: add support for U5 family#17410
benpicco merged 6 commits intoRIOT-OS:masterfrom
aabadie:pr/cpu/stm32u5

Conversation

@aabadie
Copy link
Contributor

@aabadie aabadie commented Dec 15, 2021

Contribution description

This PR adds support for the new STM32 U5 series and adds support for the B-U585i-IOT02A development kit board.

The U5 is am M33, similar to the L5 but with more RAM/Flash. As usual, there are quite some differences, especially with the clock management (2 MSIs, registers to configure the PLL are different, etc).
The port is very basic: only GPIO, UART, Flashpage and Timer peripherals are tested. There's also a configuration for I2C (that should work) but is not tested yet.
SPI registers have changed names so the driver needs to be adapted.
There's no clock configuration via Kconfig available. I don't know if that's mandatory or not.

Testing procedure

  • Green CI
  • Run compile_and_test_for_board.py:
ERROR:b-u585i-iot02a:Tests failed: 6
Failures during compilation:
- [tests/pkg_cifra](tests/pkg_cifra/compilation.failed)

Failures during test:
- [tests/malloc](tests/malloc/test.failed)
- [tests/malloc_thread_safety](tests/malloc_thread_safety/test.failed)
- [tests/periph_timer_short_relative_set](tests/periph_timer_short_relative_set/test.failed)
- [tests/pthread_rwlock](tests/pthread_rwlock/test.failed)
- [tests/sys_sema_inv](tests/sys_sema_inv/test.failed)

Some failures are related to RAM. I don't know yet what's the problem with tests/pkg_cifra.

Issues/PRs references

None

@aabadie aabadie added the Type: new feature The issue requests / The PR implemements a new feature for RIOT label Dec 15, 2021
@github-actions github-actions bot added Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Dec 15, 2021
@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Dec 15, 2021
@github-actions github-actions bot added the Area: pkg Area: External package ports label Dec 16, 2021
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 16, 2021
@benpicco
Copy link
Contributor

Code looks good!
What is the output of tests/malloc?

@aabadie
Copy link
Contributor Author

aabadie commented Dec 17, 2021

What is the output of tests/malloc?

I just keep the end (and after increasing the test timeout to 30s):

Allocated 128 Bytes at 0x0x200bf880, total 697536
Allocated 128 Bytes at 0x0x200bf918, total 697672
Allocated 128 Bytes at 0x0x200bf9b0, total 697808
Allocated 128 Bytes at 0x0x200bfa48, total 697944
Allocated 128 Bytes at 0x0x200bfae0, total 698080
Allocated 128 Bytes at 0x0x200bfb78, total 698216
Allocated 128 Bytes at 0x0x200bfc10, total 698352
Allocated 128 Bytes at 0x0x200bfca8, total 698488
Allocated 128 Bytes at 0x0x200bfd40, total 698624
Allocated 128 Bytes at 0x0x200bfdd8, total 698760
Allocated 128 Bytes at 0x0x200bfe70, total 698896
Allocated 128 Bytes at 0x0x200bff08, total 699032

Context before hardfault:
   r0: 0xffffffff
   r1: 0x200c0020
   r2: 0x0000000c
   r3: 0x00000000
  r12: 0x080023ef
   lr: 0x080014c7
   pc: 0x08001536
  psr: 0x61000000

FSR/FAR:
 CFSR: 0x00008200
 HFSR: 0x40000000
 DFSR: 0x0000000b
 AFSR: 0x00000000
 BFAR: 0x00000000
Misc
EXC_RET: 0xffffffbc
Active thread: 1 "main"
Attempting to reconstruct state for debugging...
In GDB:
  set $pc=0x8001536
  frame 0
  bt

ISR stack overflowed by at least 16 bytes.
^C

GDB doesn't give much information. I tried to change the RAM_LEN to something smaller (that corresponds to SRAM1/2/3 or just SRAM1) but it crashes the same. I don't understand the problem.

For the record, here are the outputs of the other failing tests:

tests/malloc_thread_safety
START
main(): This is RIOT! (Version: 2022.01-devel-1317-g5674d-pr/cpu/stm32u5)
Test Application for multithreaded use of malloc()
==================================================

This test will run duelling threads allocating and freeing memory.
The running thread is interrupted every millisecond and the other
threads gets scheduled. Eventually, this should yield to memory
corruption unless proper guards are in place preventing them. After
ca. two seconds without crash, the test is considered as passing.

Testing: malloc()/free()
Stack pointer corrupted, reset to top of stack
FSR/FAR:
 CFSR: 0x00008200
 HFSR: 0x40000000
 DFSR: 0x0000000b
 AFSR: 0x00000000
 BFAR: 0x00000004
Misc
EXC_RET: 0xffffffb0
Timeout in expect script at "child.expect("TEST PASSED")" (tests/malloc_thread_safety/tests/01-run.py:16)


tests/pthread_rwlock
main(): This is RIOT! (Version: 2022.01-devel-1317-g5674d-pr/cpu/stm32u5)
START
start
d2 (prio=8): sleep for    69522 µs.
start
d3 (prio=8): sleep for    95682 µs.
start
start
start
start
start
start
r2 (prio=8): 0: read  <-  0 (correct = 1)
d2 (prio=8): sleep for    80836 µs.
r3 (prio=8): 0: read  <-  0 (correct = 1)
d3 (prio=8): sleep for    20228 µs.
d7 (prio=8): sleep for   279012 µs.
w7 (prio=8): 0: write ->  1 (correct = 1)
d7 (prio=8): sleep for    42710 µs.
d3 (prio=8): sleep for    72654 µs.
d2 (prio=8): sleep for    52937 µs.
d4 (prio=9): sleep for    28038 µs.
d5 (prio=9): sleep for    25251 µs.
d6 (prio=9): sleep for    20994 µs.
r6 (prio=9): 0: read  <-  1 (correct = 1)
d6 (prio=9): sleep for    97095 µs.
r4 (prio=9): 0: read  <-  1 (correct = 1)
d4 (prio=9): sleep for    18099 µs.
r5 (prio=9): 0: read  <-  1 (correct = 1)
d5 (prio=9): sleep for     7884 µs.
r2 (prio=8): 1: read  <-  1 (correct = 1)
d2 (prio=8): sleep for    25930 µs.
r3 (prio=8): 1: read  <-  1 (correct = 1)
d3 (prio=8): sleep for    43392 µs.
d7 (prio=8): sleep for   278259 µs.
w7 (prio=8): 1: write ->  2 (correct = 1)
d7 (prio=8): sleep for   123248 µs.
d2 (prio=8): sleep for    55317 µs.
d3 (prio=8): sleep for    46098 µs.
r3 (prio=8): 2: read  <-  2 (correct = 1)
d3 (prio=8): sleep for    78386 µs.
r2 (prio=8): 2: read  <-  2 (correct = 1)
d2 (prio=8): sleep for    55048 µs.
d8 (prio=9): sleep for   167181 µs.
w8 (prio=9): 0: write ->  3 (correct = 1)
d2 (prio=8): sleep for    23545 µs.
d8 (prio=9): sleep for    92530 µs.
r2 (prio=8): 3: read  <-  3 (correct = 1)
d2 (prio=8): sleep for    88291 µs.
d7 (prio=8): sleep for   109749 µs.
w7 (prio=8): 2: write ->  4 (correct = 1)
d7 (prio=8): sleep for   194090 µs.
d3 (prio=8): sleep for    87987 µs.
d2 (prio=8): sleep for     5106 µs.
r2 (prio=8): 4: read  <-  4 (correct = 1)
d2 (prio=8): sleep for    38803 µs.
done
Stack pointer corrupted, reset to top of stack
FSR/FAR:
 CFSR: 0x00008200
 HFSR: 0x40000000
 DFSR: 0x0000000b
 AFSR: 0x00000000
 BFAR: 0x00000004
Misc
EXC_RET: 0xffffffb0
Timeout in expect script at "child.expect('done')" (tests/pthread_rwlock/tests/01-run.py:13)
tests/sys_sema_inv
START
main(): This is RIOT! (Version: 2022.01-devel-1317-g5674d-pr/cpu/stm32u5)
counter mode
THREAD 1 start
THREAD 2 start
THREAD 3 start
Stack pointer corrupted, reset to top of stack
FSR/FAR:
 CFSR: 0x00008200
 HFSR: 0x40000000
 DFSR: 0x0000000b
 AFSR: 0x00000000
 BFAR: 0x00000004
Misc
EXC_RET: 0xffffffb0
Timeout in expect script at "child.expect_exact('thread synced')" (tests/sys_sema_inv/tests/01-run.py:12)

@aabadie aabadie requested a review from miri64 as a code owner December 17, 2021 09:34
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Dec 17, 2021
@benpicco
Copy link
Contributor

"SRAM1/2/3 Non-secure" only goes to 0x200C0000 so that explains the crash in the malloc test. There is a gap and SRAM4 starts at 0x28000000.

image

You can define multiple heap regions in the linker script (e.g. see lpc23xx.ld and set NUM_HEAPS accordingly.

@aabadie
Copy link
Contributor Author

aabadie commented Dec 17, 2021

"SRAM1/2/3 Non-secure" only goes to 0x200C0000 so that explains the crash in the malloc test. There is a gap and SRAM4 starts at 0x28000000.

Yes, I saw that gap, that's why I only set RAM_LEN to be SRAM1 + 2 + 3 (768K) but it still crashes. Even with super small values of RAM_LEN (like 64K).

@aabadie
Copy link
Contributor Author

aabadie commented Dec 17, 2021

Just tried the first I2C configured with a MEMs shield, it works:

2021-12-17 11:08:13,889 # main(): This is RIOT! (Version: 2022.01-devel-1319-g37856-pr/cpu/stm32u5)
2021-12-17 11:08:13,891 # Init HTS221 on I2C_DEV(0)
2021-12-17 11:08:13,903 # H: 72.6%, T: 20.9°C
2021-12-17 11:08:15,906 # H: 72.4%, T: 21.0°C

@benpicco
Copy link
Contributor

but it still crashes. Even with super small values of RAM_LEN (like 64K).

huh that's strange - what address is it crashing on then?

@aabadie
Copy link
Contributor Author

aabadie commented Dec 17, 2021

what address is it crashing on then?

When I set 64K, it's crashing at r1: 0x20010008, with 768K, it crashes at r1: 0x200c0020 (not sure if r1 is the right value to check but it seems to be that).

Maybe there's a reserved space ? I couldn't find any information about that.

@aabadie
Copy link
Contributor Author

aabadie commented Dec 23, 2021

I think I'll open an issue about them.

Done => #17439

I also added 7e3256a with your suggestion about the second heap.

@aabadie aabadie force-pushed the pr/cpu/stm32u5 branch 2 times, most recently from 2c628b2 to b5509b2 Compare December 23, 2021 11:10
ifeq (u5,$(CPU_FAM))
LINKER_SCRIPT ?= stm32u5.ld
else
LINKER_SCRIPT ?= stm32.ld
Copy link
Contributor

@benpicco benpicco Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't realize we already have a custom linker script for stm32 - then let's use this instead

diff --git a/cpu/stm32/Makefile.include b/cpu/stm32/Makefile.include
index 884890ccc1..406f58a34c 100644
--- a/cpu/stm32/Makefile.include
+++ b/cpu/stm32/Makefile.include
@@ -61,6 +61,9 @@ info-stm32:
 ifneq (,$(CCMRAM_LEN))
   LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ccmram_length=$(CCMRAM_LEN)
 endif
+ifneq (,$(SRAM4_LEN))
+  LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_sram4_length=$(SRAM4_LEN)
+endif
 
 VECTORS_O ?= $(BINDIR)/stm32_vectors/$(CPU_LINE).o
 VECTORS_FILE = $(RIOTCPU)/stm32/vectors/$(CPU_LINE).c
diff --git a/cpu/stm32/ldscripts/stm32.ld b/cpu/stm32/ldscripts/stm32.ld
index fb50fcf119..3e429d879d 100644
--- a/cpu/stm32/ldscripts/stm32.ld
+++ b/cpu/stm32/ldscripts/stm32.ld
@@ -19,10 +19,12 @@
  */
 
 ccmram_length = DEFINED( ccmram_len ) ? ccmram_len : 0x0 ;
+sram4_length = DEFINED( sram4_length ) ? sram4_length : 0x0 ;
 
 MEMORY
 {
     ccmram  : ORIGIN = 0x10000000, LENGTH = ccmram_length
+    sram4   : ORIGIN = 0x28000000, LENGTH = sram4_length
 }
 
 INCLUDE cortexm.ld

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah but why remove

#define NUM_HEAPS   2

from cpu_conf.h ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know why it's required, I thought it was useless.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used by syscalls.c to provide non-continuous memory sections as additional heap used by malloc

@dylad
Copy link
Member

dylad commented Dec 24, 2021

nRF9160 seems not affect by your issue. tests/malloc runs without any problem on it.

@aabadie
Copy link
Contributor Author

aabadie commented Dec 24, 2021

nRF9160 seems not affect by your issue. tests/malloc runs without any problem on it.

Are you using ARM GCC 10 ?

@dylad
Copy link
Member

dylad commented Dec 24, 2021

Are you using ARM GCC 10 ?

Yes, my local version is gcc version 10.2.1 20201103 (release) (GNU Arm Embedded Toolchain 10-2020-q4-major)

@aabadie aabadie force-pushed the pr/cpu/stm32u5 branch 2 times, most recently from c4309c1 to 2290601 Compare January 2, 2022 14:23
@benpicco
Copy link
Contributor

benpicco commented Jan 2, 2022

Oh but but NUM_HEAPS = 2 corresponds to _sheap1 being present - this is typically backup RAM. If STM32U5 also has that, we can bump NUM_HEAPS to 3 and all is fine. But this would require #16870.

So for now we can change SRAM4 to _sheap1 and change it back to _sheap2 when adding backup RAM support.

@aabadie
Copy link
Contributor Author

aabadie commented Jan 2, 2022

So for now we can change SRAM4 to _sheap1 and change it back to _sheap2 when adding backup RAM support.

I think I've done that but not sure.

@benpicco benpicco merged commit 40a6000 into RIOT-OS:master Jan 2, 2022
@aabadie aabadie deleted the pr/cpu/stm32u5 branch January 2, 2022 18:54
@aabadie
Copy link
Contributor Author

aabadie commented Jan 2, 2022

Thanks @benpicco for reviewing and merging !

@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
bors bot added a commit that referenced this pull request Jul 24, 2023
19817: compile_and_test_for_boards: Add no-compile flag r=benpicco a=MrKevinWeiss


### Contribution description

Since we have a no-test flag that prevents executing tests, I think a no-compile flag is a nice compliment. Why? Well if I want to use this script for running multiple boards at the same time, RIOT is not so great handling parallel compile steps with conflicts on lockfiles happening, mostly due to packages. With this I can compile a list of boards sequentially, then flash and run tests in parallel, skipping the compile step.


### Testing procedure

Run the following once to compile and clean:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --clean-after
```

Then try to run without the compile step and it should fail due to lack of the binary
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --no-compile
```

### Issues/PRs references


19826: ztimer/periodic: reinit remove from right clock and handle aquired ztimer r=benpicco a=kfessel

### Contribution description

#19806 added some retinit handling for ztimer periodic removing the timer from the new clock 

This tries to detect if this is a reinit and remove the timer from the old clock
this also removes the ztimer_acquire/_release handling by removing now calls in favour of set return value and now values  that are allready in ztimer,
that also has the potential to reduce the jitter of the periodic calls and bus-usage (for cpus that take their time to get "now") 

### Testing procedure

read

run tests/sys/ztimer_periodic

### Issues/PRs references

Fixes #19806 

19841: boards/adafruit-itsybitsy-nrf52: Add configuration for DotStar LED r=benpicco a=jimporter



19842: cpu/stm32: fix ld script for SRAM4 r=benpicco a=gschorcht

### Contribution description

This PR fixes the LD script for STM32.

Since the CCM and SRAM4 length are defined as symbols with perifx `_`, the LD script didn't use them correctly. Instead of using `ccmram_length` and `sram4_length`, `_ccmram_length` and `_sram4_length` have to be used. Furthermore, the location counter for the SRAM has to be set to the beginning of SRAM4 to work.

BTW, I don't understand why the `ccmram` region is defined. There is no section definition that would use it to place code or data with attribute `.ccmram.*` there.

Without the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board were:
```python
00000000 T _sheap2     <== wrong start position because of wrong location counter
28000000 T _eheap2     <== wrong end position because of `sram4_length` is 0.
```
Although the `tests/sys/malloc` crashes for `b-u585i-iot02a` at the end of the heap (known problem, see [here](#17410 (comment))), it uses only the backup RAM before it crashes:
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
```

With the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board are:
```python
28000000 T _sheap2     <== correct start position
28004000 T _eheap2     <== correct end position
```
`tests/sys/malloc` also crashes for the `b-u585i-iot02a` at the end of the heap, but it uses also the SRAM4 before it crashes.
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
Allocated 512 Bytes at 0x28000008, total 759712
Allocated 512 Bytes at 0x28000210, total 760232
Allocated 512 Bytes at 0x28000418, total 760752
...
Allocated 512 Bytes at 0x280038e8, total 774272
Allocated 512 Bytes at 0x28003af0, total 774792
Allocated 512 Bytes at 0x28003cf8, total 775312
```

### Testing procedure

1. Flash `tests/sys/malloc` and use `MAX_MEM` limit to stop `malloc` before the crash:
   ```
   CFLAGS='-DMAX_MEM=774800 -DCHUNK_SIZE=512 -DDEBUG_ASSERT_VERBOSE' \
   BOARD=b-u585i-iot02a make -j8 -C tests/sys/malloc flash
   ```
   Without the PR it crashes at the end of the backup RAM. With the PR it works.

2. Check `_sheap2` and `_eheap2` with
   ```
   nm -s tests/sys/malloc/bin/b-u585i-iot02a/tests_malloc.elf | grep heap2 | sort
   ```
   Without the PR it will be:
   ```
   00000000 T _sheap2
   28000000 T _eheap2
   ```
   With the PR it should be:
   ```
   28000000 T _sheap2
   28004000 T _eheap2
   ```

### Issues/PRs references


Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Jim Porter <jporterbugs@gmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@gschorcht
Copy link
Contributor

gschorcht commented Jul 25, 2023

@aabadie @benpicco

What is the output of tests/malloc?

I just keep the end (and after increasing the test timeout to 30s):

...
Allocated 1024 Bytes at 0x200bf568, total 767800
Allocated 1024 Bytes at 0x200bf980, total 768832

Context before hardfault:
   r0: 0xffffffff
   r1: 0x200c0198
   r2: 0x0000000c
   r3: 0x00000000
  r12: 0x0000000a
   lr: 0x0800167b
   pc: 0x080016ea
  psr: 0x61000000

I tried to figure out what the problem is. The hard fault happens here (debugger output)

  r0   0xffffffff  -1              r1    0x200c0198   537657752
  r2   0xc         12              r3    0x0          0
  r4   0x0         0               r5    0x408        1032
  r6   0x0         0               r7    0x20000220   536871456
  xpsr 0x61000000  1627389952      fpscr 0x0          0
  msp  0x200001c8  0x200001c8      psp   0x20000800   0x20000800
...
     0x80016d8 <_malloc_r+56>        bl      0x8001660 <sbrk_aligned>
     0x80016dc <_malloc_r+60>        adds    r3, r0, #1
     0x80016de <_malloc_r+62>        mov     r4, r0
     0x80016e0 <_malloc_r+64>        bne.n   0x800177e <_malloc_r+222>
     0x80016e2 <_malloc_r+66>        ldr     r4, [r6, #0]
     0x80016e4 <_malloc_r+68>        mov     r6, r4
     0x80016e6 <_malloc_r+70>        cmp     r6, #0
     0x80016e8 <_malloc_r+72>        bne.n   0x800176c <_malloc_r+204>
  >  0x80016ea <_malloc_r+74>        ldr     r3, [r4, #0]

after calling sbrk_aligned when it returns -1 (0xffffffff) in r0.

The return value from sbrk_aligned is tested for -1 and a jump to _malloc_r+222 is executed @0x80016e0 if it is not -1.

However, if sbrk_aligned returns -1, r4 is loaded with [r6 + 0x0] @0x80016e2 that is just the __malloc_free_list which is NULL at that moment. After copying r4 to r6 @0x80016e4, r4 and r6 then contain the value of __malloc_free_list, that is 0x0 at that moment.

To be honest, I'm a bit confused by the code. If I'm right, bne.n leads to a jump if the Z-flag is not set by the cmp instruction, that is if r6 is not 0x0. However, if r6 is 0x0, the jump it isn't executed and ldr r3, [r4, #0] is executed instead. But if r6 is 0x0, r4 is also 0x0 and ldr r3, [r4, #0] would try to load r3 from 0x00000000. This leads to the hard-fault on U5 but seems to be no problem on F4.

I think the corresponding source code can be found here in lines 308-324. The crash happens on dreferencing r in line 323.

308        r = sbrk_aligned(RCALL alloc_size);
309
310        /* sbrk returns -1 if fail to allocate */
311        if (r == (void *)-1)
312        {
313            /* sbrk didn't have the requested amount. Let's check
314             * if the last item in the free list is adjacent to the
315             * current heap end (sbrk(0)). In that case, only ask
316             * for the difference in size and merge them */
317            p = free_list;
318            r = p;
319
320            while (r)
321            {
322                p=r;
323                r=r->next;
324            }

So the question is how can the processor enter the while loop if r is NULL?

@gschorcht
Copy link
Contributor

gschorcht commented Jul 25, 2023

BTW, it seems to work with the gcc 12.2 toolchain.

@gschorcht
Copy link
Contributor

It does indeed seem to be a bug in the newlib bundled with gcc 10.3 2021.10. The code in gcc 12.2 seems to be slightly differen at the point in question:

   8001f4a:	f7ff ffbf 	bl	8001ecc <sbrk_aligned>
   8001f4e:	1c43      	adds	r3, r0, #1
   8001f50:	4604      	mov	r4, r0
   8001f52:	d158      	bne.n	8002006 <_malloc_r+0xf6>
   8001f54:	f8d8 4000 	ldr.w	r4, [r8]
   8001f58:	4627      	mov	r7, r4
   8001f5a:	2f00      	cmp	r7, #0
   8001f5c:	d143      	bne.n	8001fe6 <_malloc_r+0xd6>
-> 8001f5e:	2c00      	cmp	r4, #0
-> 8001f60:	d04b      	beq.n	8001ffa <_malloc_r+0xea>
   8001f62:	6823      	ldr	r3, [r4, #0]

It now tests r4 for 0x0 before the instruction ldr r3, [r4, #0].

@gschorcht
Copy link
Contributor

gschorcht commented Jul 25, 2023

This was obviously the fix and the description

@gschorcht
Copy link
Contributor

gschorcht commented Jul 25, 2023

So we can't do anything from our side other than to upgrade to the gcc 12.2 toolchain.

@benpicco
Copy link
Contributor

Fortunately that's also what Ubuntu ships these days

arm-none-eabi-gcc (15:12.2.rel1-1) 12.2.1 20221205

We'll just have to update riotdocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports Area: tests Area: tests and testing framework Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants