DWM3000 with STM32L433 undefined reference in library

Hello everyone,

I’m trying to use a DWM3000 with the DWM3xxx API from the DW3xxx_XR6.0C_24Feb2022 release.
I try my best to port it from the F429 on STMCube IDE but I’m am now stuck in an error thorwn by the compilator.
I’m sure there is nothing wrong with the library but it might be something I didn’t do.
Here are the errors :
"undefined reference to __dw_drivers_end' " and "undefined reference to __dw_drivers_start’ "
from " lib\libdwt_uwb_driver-m4-hfp-6.0.7.a(deca_compat.c.obj): in function `dwt_probe’: ".

To get to this error(s) I tried to add the code from the API to my current STM32L433 project.
Try to use the code for the Nucleo F429 that was located in the “platform” folder to adapt it to my microcontroller.
If someone already succesfully managed to port it to another STM I would love to see that.

So I added the part about the dw_drivers linker from the Nucleo to my project to solve the errors I was getting.

After getting rid of the errors I was getting an hard fault that I tried to fix again thanks to the advices from bruno on this post talking about how to properly configure the library on STMCubeIDE:

  1. Add in the linker script what is told in the API guide
    /* The program code and other data into “FLASH” Rom type memory /
    .text :
    . = ALIGN(4);
    __dw_drivers_start = .;
    __dw_drivers_end = .;

  2. Do not include the static library in the regular way, IT WILL NOT WORK! Do this instead (in my project I am using M4 core so I picked the suitable API library)

So you leave Libraries (-I) empty BUT in MCU G++ Linker Miscellaneous you add in “other flags” what is shown in the picture (remember to use a suitable API library for your core)

So in my project I added “-Wl,–whole-archive -ldwt_uwb_driver-m4-hfp-6.0.7 -Wl,–no-whole-archive” in “Other flags” in “Miscellanous” of “MCU GCC Linker” and the path to the library in “Library search path (-L)”. I got rid of the dw3000 library path in “Libraries”.

Now I’m stuck again with an hard fault when calling dwt_readdevid() and it seems that dwt_probe() fails as I get DWT_ERROR and when calling dwt_apiversion() I get “0x80127b1” in return.

I think it should be something like “0x060007” for the version of the library (6.0.7) that I’m using so I guess the library isn’t properly loaded.

I’m not familiar with the linker configuration and I’m a bit lost for now. I keep reading the DW3XX_Software_API_Guide_2p2 to see if I missed something.

Is there anything obvious that I missed?

Can you post the same 2 pictures that I posted? to see how it looks yours…

Hi bruno,

Thanks for you interest in my problem. Here are the images :

Libraries :

Miscellaneous - Other flags :

It looks ok for me, what STM32 are you using? I am using M4 family and it worked, but I don’t know if it works with M0,M1, etc. I also used hfp, I don’t know what sfp is for, you may wanna try it.
Anyway here is a piece of code I used for going directly to DWM3000 (just using some code borrow from the old DWM1000 api) so you can be sure that can establish communication with DWM3000; not using DWM3000 api just to make sure your hw setting and etc is ok. Try with SPI in low speed also (3Mbps, 4Mbps something like that).
Here is the piece of code (new version, use this), make sure the first function is properly configured to the SPI you are using for connecting the DWM3000:
read_id_directly.c (4.3 KB)

I’m using STM32L433 so it’s also from the M4 family.

I tried my luck with the soft floating point version of the library but I got exactly the same problem.

And I tried the code you sent me and it seems you’re right I might have a wiring or settings issue that I’ll investigate on.