RTEMS | 6.1 GR740 SMP Driver Manager build fail (#5269)
Matteo Concas (@matteo.concas)
gitlab at rtems.org
Tue Jun 17 07:52:56 UTC 2025
Matteo Concas created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5269
## Summary
Building the GR740 BSP with `RTEMS_SMP` and `RTEMS_DRVMGR_STARTUP` set to True will fail in multiple ways.
The issues appear in `bsps/shared/grlib/btimer/tlib_ckinit.c` .
### First issue
Excerpt from the build log:
```
../../../bsps/shared/grlib/btimer/tlib_ckinit.c: In function 'irqamp_get_timecount':
../../../bsps/shared/grlib/btimer/tlib_ckinit.c:373:28: error: 'irqamp' has no member named 'timestamp'
373 | return LEON3_IrqCtrl_Regs->timestamp[0].counter;
| ^~
```
The first issue appears in every instance of `LEON3_IrqCtrl_Regs->timestamp[0]` such as:
```c
irqmp_ts = &LEON3_IrqCtrl_Regs->timestamp[0];
```
This stems from an earlier change where the type of the IRQ(A)MP timestamp register block was changed from `irqmp_timestamp_regs` to `irqamp_timestamp`. These two types represent the same thing but have different names for their members.
##### Possible fix
This can be fixed by using `&LEON3_IrqCtrl_Regs->itstmp[0];` instead.
### Second issue
Excerpt from the build log:
```
/opt/rtems/rtems-7-sparc/bin/../lib/gcc/sparc-rtems7/13.4.0/../../../../sparc-rtems7/bin/ld: ./librtemsbsp.a(tlib_ckinit.c.9.o): in function `tlib_clock_find_timer':
/home/matteo/dev/rtems-gaisler/build/sparc/gr740_smp/../../../bsps/shared/grlib/btimer/tlib_ckinit.c:141:(.text._Clock_Initialize+0x30): undefined reference to `leon3_up_counter_is_available'
collect2: error: ld returned 1 exit status
```
The second issue appears when linking the object files, the `tlib_clock_find_timer()` function calls `leon3_up_counter_is_available()` (declared and defined in `bsps/sparc/leon3/include/bsp/leon3.h`) but this function is only available when the BSP is defined as not having the SPARC ASR22 and ASR23 registers. This is not the case for the GR740 BSP:
```ini
LEON3_HAS_ASR_22_23_UP_COUNTER = True
```
>From the output of `./waf bspdefaults --rtems-bsp=sparc/gr740` .
##### Possible fix
I am not sure why `leon3_up_counter_is_available()` is not always defined like the rest of the up_counter functions in the file. Removing the define guards fixes the issue.
## Steps to reproduce
Create a `gr740.ini` file with the following contents:
```ini
[sparc/gr740_smp]
INHERIT=gr740
RTEMS_SMP=True
RTEMS_DRVMGR_STARTUP=True
```
Run `./waf configure --prefix=$RTEMS_PREFIX --rtems-config=gr740.ini` and then `./waf` .
## Expected behaviour
The build should complete successfully.
/bsp sparc/gr740
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5269
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250617/0e9bbe71/attachment-0001.htm>
More information about the bugs
mailing list