A121 Integration using STM32CubeIDE
6
Troubleshooting and FAQ
6.1
Example Fails
The example program can fail for different reasons, here are a few common reasons.
6.1.1
Sensor Creation Returns NULL
The function acc_sensor_create returns NULL. This is most likely because the pins have either been connected wrong or
some other pin fault. Usually due to an SPI communication problem. Could be due to incorrectly connected pins, drivers
are incorrect, or the signals sent to the radar are in the wrong order. See section 6.3 Troubleshooting SPI Communication
for more information.
6.1.2
Config Creation Hardfaults
The function acc_config_create hardfaults. Most likely due to memory problems. Depending on the memory of the MCU,
heap and stack might overwrite each other. Or there is simply not enough memory.
Are you using FREERTOS? Make sure that the thread that is handling the Acconeer software has enough stack size to be
able to run the software.
6.2
The Program is Stuck in HAL_Delay
If the program keeps entering HAL_Delay() or seems to be “stuck” there for longer periods of time, it might be because
the interrupt pin is not connected or malfunctioning.
6.3
Troubleshooting SPI Communication
The following function can be used to find problems in the SPI communication with the radar sensor.
# include " acc_hal_integration_a121 .h"
bool hal_test_spi_read_chipid ( void )
{
const uint32_t sensor = 1;
const acc_hal_a121_t * hal = acc_hal_rss_integration_get_implementation () ;
uint8_t buffer [6] = {0 x30 , 0x0 , 0x0 , 0x0 , 0x0 , 0 x0 };
acc_hal_integration_sensor_supply_on ( sensor );
acc_hal_integration_sensor_enable ( sensor );
hal -> transfer ( sensor , buffer , sizeof ( buffer ));
acc_hal_integration_sensor_disable ( sensor );
acc_hal_integration_sensor_supply_off ( sensor );
if ( buffer [4] == 0 x12 && buffer [5] == 0 x10 )
{
printf (" Test OK !\ n");
return true ;
}
printf (" Cannot read chip id !\ n");
return false ;
}
When the program is executed, the signals to the A121 should look as in figure 16.
© 2022 by Acconeer AB - All rights reserved
Page 20 of 23