cancel
Showing results for 
Search instead for 
Did you mean: 

How to add ST25RU3993 library/firmware STUHFL in STM32CubeIDE for NUCLEO-L476RG

VKarl.2
Associate

Hi!

I have a NUCLEO-L476RG board that I want to use to control the ST25RU3993-HPEV board with. I am not interested in using the onboard processor on the dev-board, but instead use an independent processor. Among other reasons I need this setup because I have several other external devices I need to control as well.

I am now trying to include the library to my NUCLEO-L476RG project using STM32CubeIDE, but I am quite unsure on how to manage this.

Can anybody provide some kind of guide on how to achieve this kind of setup? What part of the STUHFL files do I need to include and how do I include them?

Thank you in advance,

/Viktor

1 ACCEPTED SOLUTION

Accepted Solutions
Nick K
ST Employee

Hello VKarl.2,

If you want to replace the onboard MCU with a different one you have to apply HW & FW changes to your setup.

HW changes 

For the HW changes pleases have a look to schematic for details https://www.st.com/resource/en/schematic_pack/st25ru3993-hpev_v1_schematics.pdf

  • Remove zero ohm resistors: R7 – R13 to disconnect onboard MCU from SPI & control line. 
  • External SPI connections to new MCU: EN -> J12.3, IRQ -> J12.4, NCS -> J12.5, CLK -> J10.1, MOSI -> J10.2, MISO -> J10.3
  • Disable the Onboard MCU: Remove R61, short C25 (solder bridge)
  • To control usage of internal and external PA the onboard RF switch must be control external from the new MCU. Remove R90 & R91 and connect new PA switch control lines to J30
  • To deactivate the external PA and reduce power consumption in the idle state remove R43 and control the external PA supply enable line via J4.
  • To control the RF Switch for Antenna Output remove R92 & R93 connect new switch control lines to J31
  • To control the Control Carrier Cancellation Circuit (CCC) external remove R38-R40 and connect the the three SPI enable lines of the tunable capacitors via J13

FW changes

For STM32 MCU's open the ST25RU3993_Eval.ioc project file from the STUHFL SDK package "./Firmware/Eval" and check all connections to the peripherals and adopt them to reflect your HW changes.

To run the FW on a NUCLEO-L476RG board means you use the same STM32L4RGTx MCU. Therefore, no need to change any settings of used MCU itself, the core or peripheral settings is needed.

After generating the new NUCLEO-L476RG project for STM32CubeIDE or KEIL you have a empty project.

In the Eval FW project sources of the STUHFL SDK package you find in the "./Firmware/Src" and "./Firmware/Inc" folders all sources that are platform independent. Include them into your project.

Also include the path to the "./Middleware/clib/STUHFL/inc" and "./Middleware/clib/STUHFL/inc/platform" to your project include path.

In this folder all defines & prototypes located that shared between the FW and the host application.

As you stay on the STM32L4 last step is to compare, check and merge all modification inside the STM32CubeIDE generated files from the user code sections.

These are the platform dependent files and can be found in "./Firmware/Eval/Src" and "./Firmware/Eval/Inc"

NOTE: By default the FW uses 3MBaud for UART host communication. The build in UART-USB converter of the ST-Link on the STM32L4 Nucleo support only 115KBaud

Please use on the Nucleo board one of the UARTs accessible via the pin header and connect there a UART-USB converter cable. When changing the UART please do not forget to update in the STM32CubeIDE configuration and FW to reflect the new UART setting.

BR

Nick

View solution in original post

3 REPLIES 3
Nick K
ST Employee

Hello VKarl.2,

If you want to replace the onboard MCU with a different one you have to apply HW & FW changes to your setup.

HW changes 

For the HW changes pleases have a look to schematic for details https://www.st.com/resource/en/schematic_pack/st25ru3993-hpev_v1_schematics.pdf

  • Remove zero ohm resistors: R7 – R13 to disconnect onboard MCU from SPI & control line. 
  • External SPI connections to new MCU: EN -> J12.3, IRQ -> J12.4, NCS -> J12.5, CLK -> J10.1, MOSI -> J10.2, MISO -> J10.3
  • Disable the Onboard MCU: Remove R61, short C25 (solder bridge)
  • To control usage of internal and external PA the onboard RF switch must be control external from the new MCU. Remove R90 & R91 and connect new PA switch control lines to J30
  • To deactivate the external PA and reduce power consumption in the idle state remove R43 and control the external PA supply enable line via J4.
  • To control the RF Switch for Antenna Output remove R92 & R93 connect new switch control lines to J31
  • To control the Control Carrier Cancellation Circuit (CCC) external remove R38-R40 and connect the the three SPI enable lines of the tunable capacitors via J13

FW changes

For STM32 MCU's open the ST25RU3993_Eval.ioc project file from the STUHFL SDK package "./Firmware/Eval" and check all connections to the peripherals and adopt them to reflect your HW changes.

To run the FW on a NUCLEO-L476RG board means you use the same STM32L4RGTx MCU. Therefore, no need to change any settings of used MCU itself, the core or peripheral settings is needed.

After generating the new NUCLEO-L476RG project for STM32CubeIDE or KEIL you have a empty project.

In the Eval FW project sources of the STUHFL SDK package you find in the "./Firmware/Src" and "./Firmware/Inc" folders all sources that are platform independent. Include them into your project.

Also include the path to the "./Middleware/clib/STUHFL/inc" and "./Middleware/clib/STUHFL/inc/platform" to your project include path.

In this folder all defines & prototypes located that shared between the FW and the host application.

As you stay on the STM32L4 last step is to compare, check and merge all modification inside the STM32CubeIDE generated files from the user code sections.

These are the platform dependent files and can be found in "./Firmware/Eval/Src" and "./Firmware/Eval/Inc"

NOTE: By default the FW uses 3MBaud for UART host communication. The build in UART-USB converter of the ST-Link on the STM32L4 Nucleo support only 115KBaud

Please use on the Nucleo board one of the UARTs accessible via the pin header and connect there a UART-USB converter cable. When changing the UART please do not forget to update in the STM32CubeIDE configuration and FW to reflect the new UART setting.

BR

Nick

SSing.10
Associate II

Hi Nick k,

What if we change and replace the STM32L4 to STM32G4 MCU, then how can be perform the migration for the same.

As I have changed the MCU and I need to develop same using STM32G4 MCU.

So I request you please provide step and guidance for migration & also share document if available for migrations.

Thanks & Regards

Sachin

Nick K
ST Employee

Hello Sachin,

porting from STM32L4 to STM32G4 works also with the approach described above. Sorry, but there is no further documentation available at the moment.

BR

Nick