DWM3000 with STM32L433 undefined reference in library

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?