cancel
Showing results for 
Search instead for 
Did you mean: 

rfid tag reader on STM32U083xx without NFC08A1 board

Mihaita Ivascu
Associate III

Hello,

 

    I had configured in older post

Solved: Re: is there any sample for X-NUCLEO-NFC08A1 to be... - STMicroelectronics Community

an stm32 example for tag polling for stm32u083RCxx family and using a NFC08A1 extension interface like here:

MihaitaIvascu_0-1754057019686.png

 

but now after some hw redesign I will not have nfc08A1 board anymore. 

 Is it enough for me to go back to cubemx example and regenerate it without Board Extension NFC option?

   

Thanks,

     Mihai

4 REPLIES 4
Brian TIDAL
ST Employee

Hi,

that should work: just unselect the various X-CUBE-NFC6 components in in Software Pack > Select components.  Then you may have to manually clean up the project file to remove references to the RFAL source files.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello BT,

 

    Thanks for your answer.

    I thought rfal lib is needed anyway to use st25r3916b driver, not only when using nfc081 ?

    My expectation is that I only need to remove that code encircled in the snapshot(meaning to uncheck only the nfc extension board support). Will look at it

 

MihaitaIvascu_0-1754064645623.png

 

vlpl
Associate

Piggybacking off this topic, since the thread mention in the OP is locked now.

Using the same NFC08A1, I'm trying to generate code without the LED and UART COM dependencies, but it seems code generation fails on nfc_conf.h.

To be clear, I previously started from this config:

vlpl_0-1754067006787.png

I cannot use this config, since other than the pins set under "Found Solutions", I have no free pins to assign to the LEDs. Moreover, I've defined my own logger, and I am using the Virtual COM from the BSP -> Human Machine Interface, which occupies USART2. Due to other config options, only USART1 is available, which is used for a different component.

Leaving the pins as "undefined" causes CubeMX to generate code that does not compile, because the #define's for the various LEDs are left incomplete:

vlpl_1-1754067272594.png

These are the pins used here:

vlpl_2-1754067326217.png

Moreover, you can see the generated code uses BSP_COM_INIT(COM1), which is undefined, since no UART option is given to the X-CUBE-NFC6 config.

 

I've tried moving to a config that only uses SPI and RFAL (which I assume is enabled by the "Wireless MID LIB" option?):

vlpl_3-1754067424408.png

But this causes the generation to fail for nfc_conf.h (fails silently, CubeMX itself reports no error):

/**
 ******************************************************************************
 * @file           : nfc_conf.h
 * @brief          : This file contains definitions for the NFC6/8 components bus interfaces
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2025 STMicroelectronics.
 * All rights reserved.
 *
 * This software is licensed under terms that can be found in the LICENSE file
 * in the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 *
 ******************************************************************************
 */


/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __NFC0XA1_CONF_H__
    #define __NFC0XA1_CONF_H__

    #ifdef __cplusplus
extern "C" {
    #endif

FreeMarker template error (DEBUG mode; use RETHROW in production!):
The following has evaluated to null or missing:
==> SWIPdatas [in template "nfc_conf_h.ftl" at line 279, column 8]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either
specify a default value like myOptionalVar!myDefault, or use [#if
myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover
the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #list SWIPdatas as SWIP [in template "nfc_conf_h.ftl" at line 279, column 1]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
at freemarker.core.Expression.assertNonNull(Expression.java:249)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:104)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.visitAndTransform(Environment.java:501)
at freemarker.core.CompressedBlock.accept(CompressedBlock.java:42)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:340)
at freemarker.core.Environment.process(Environment.java:313)
at freemarker.template.Template.process(Template.java:383)
at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:420)
at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:273)
at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:6459)
at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCode(CodeGenerator.java:5281)
at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCodeFile(CodeGenerator.java:1862)
at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:2188)
at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:10991)
at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1593)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:3343)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2235)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:819)
at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61)

I've tested with only the 1st option removed (as in the OP), but that results in the same code generation error).

Any guidance on how to proceed w/o defining all the options for the 1st config, or on how to fix the code generation for the 2nd config would be much appreciated.

 

EDIT:

I would assume changes need to be made to the software package, but i.e. disabling board extension gives warnings:

vlpl_4-1754068576000.png

Generating with only these software packages results in the same nfc_conf.h generation error.

After further testing, it seems the nfc_conf.h generation error happens every time all 4 options are NOT selected, either from software packages or in the configuration itself.

The same error as in the nfc_conf.h file is reported in the terminal when running the generation:

2025-08-01 21:07:22,124 [INFO] IP:3329 - RTE Config file name : RTE_Component
2025-08-01 21:07:22,124 [INFO] IP:3347 - RTE template : RTE_Components.ftl
2025-08-01 21:07:22,125 [INFO] CodeEngine:265 - oldGeneratedFile, /home/<user>/work/Inc/common.h_save
2025-08-01 21:07:22,150 [INFO] CodeEngine:289 - Generated code: /home/<user>/work/Inc/common.h
2025-08-01 21:07:22,151 [INFO] CodeEngine:265 - oldGeneratedFile, /home/<user>/work/Inc/nfc_conf.h_save
2025-08-01 21:07:22,189 [ERROR] CodeEngine:430 - The following has evaluated to null or missing:
==> SWIPdatas  [in template "nfc_conf_h.ftl" at line 279, column 8]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
        - Failed at: #list SWIPdatas as SWIP  [in template "nfc_conf_h.ftl" at line 279, column 1]
----
2025-08-01 21:07:22,189 [INFO] CodeEngine:289 - Generated code: /home/<user>/work/Inc/nfc_conf.h

This is with CubeMx v6.15.0.

Hello BT,

 

    I have read that I can use x-cube-nfc6 even though I don't have the nfc08a1 interface, just to disable only the first option above(Board extension interface)?

    Because if I disable x-cube-nfc6 altogether, then how I generate the nfc application again?

 

Thanks,

     Mihai