Hi Luke,
Can you share more information about your setup:
- Do you use the ST25R3916 or the ST25R3911B reader?
- What is your compiler?
- which STM32L0 do you use?
The RFAL code is scalable through the platform.h file. To remove useless features in your application, you just need to change the "RFAL FEATURES CONFIGURATION" in the platform.h. For example, if your application only needs to support NFC-A/T2T tags, the following features configuration can be used.
/*
*****************************************************
* RFAL FEATURES CONFIGURATION
*****************************************************
*/
#define RFAL_FEATURE_LISTEN_MODE false
#define RFAL_FEATURE_WAKEUP_MODE false
#define RFAL_FEATURE_LOWPOWER_MODE false
#define RFAL_FEATURE_NFCA true
#define RFAL_FEATURE_NFCB false
#define RFAL_FEATURE_NFCF false
#define RFAL_FEATURE_NFCV false
#define RFAL_FEATURE_T1T false
#define RFAL_FEATURE_T2T true
#define RFAL_FEATURE_T4T false
#define RFAL_FEATURE_ST25TB false
#define RFAL_FEATURE_ST25xV false
#define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG false
#define RFAL_FEATURE_DPO false
#define RFAL_FEATURE_ISO_DEP false
#define RFAL_FEATURE_ISO_DEP_POLL false
#define RFAL_FEATURE_ISO_DEP_LISTEN false
#define RFAL_FEATURE_NFC_DEP false
Then, you can remove the USE_LOGGER define (printf on the serial console) and remove the UART.
Also, make sure to use the proper level of optimization in the compiler options (Optimize for size). See https://www.keil.com/appnotes/files/apnt202.pdf if using Keil µVision.
demo_polling.c file can also be modified to get rid of demoP2P, demoAPDU, demoNfcv, demoNfcf and demoCE and reduce the size of demo_polling.o.
You should then be close to the 16k flask size limit.
Once those suggestions are applied, feel free to share the map file of your application if you are still exceeding the 16k.
Rgds
BT