cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault on SPI transmit

Woula
Associate II
 
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You're missing some important & symbols.

	HAL_SPI_Transmit(&hspi2, (uint8_t*) &temp_address, 2, 1000);
	HAL_SPI_Receive(&hspi2, (uint8_t*) &returnData, 4, 1000);

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
Woula
Associate II

Hi,

I'm trying to send some command data fron STM32F769NI-DISCO to an ADE9000 though SPI. But my program never send commands because a HardFault is triggererd when HAL_SPI_Transmit ... function is called .

Here is the function that causes trouble. What could be the problem, please ?

uint32_t SPI_Read_32(uint16_t Address) {
	uint16_t temp_address;
	uint32_t returnData;
 
	ADE9000_ENABLE
 
	temp_address = (((Address << 4) & 0xFFF0) + 8);
 
	HAL_SPI_Transmit(&hspi2, (uint8_t*) temp_address, 2, 1000);
	HAL_SPI_Receive(&hspi2, (uint8_t*) returnData, 4, 1000);
 
	ADE9000_DISABLE
 
	return returnData;
 
}

Thanks !

TDK
Guru

You're missing some important & symbols.

	HAL_SPI_Transmit(&hspi2, (uint8_t*) &temp_address, 2, 1000);
	HAL_SPI_Receive(&hspi2, (uint8_t*) &returnData, 4, 1000);

If you feel a post has answered your question, please click "Accept as Solution".
Woula
Associate II

Thank you very much. This solved my problem!​