2017-08-15 09:00 AM
According to AN3154 Datasheet I must write sector code in data field.But I dont know what is sector code and How can i find it for stm32f4 discovery?Just I want to erase sector by sector what I must do?(I know I must write stdid=>0x43 dlc=>? data=?)
2017-08-15 10:21 AM
Hi,
Sector code is the number of the sectors , for example if you want to Erase 4 first sectors, you need to send the their numbers : 0 , 1 , 2, 3. as in our Reference Manual for STM32F405/407 of that discovery RM0090.
Check also if it is an Erase 0x43 or Extended Erase 0x44 in AN2606/AN3154.
Cheers,
STOne-32.
2017-08-16 02:47 AM
I write like this to erase 4 first sectors but not working...
hcan.pTxMsg->StdId = 0x43;
hcan.pTxMsg->RTR = CAN_RTR_DATA; hcan.pTxMsg->IDE = CAN_ID_STD; hcan.pTxMsg->DLC = 4; hcan.pTxMsg->Data[0] = 0x00; hcan.pTxMsg->Data[1] = 0x01; hcan.pTxMsg->Data[2] = 0x02; hcan.pTxMsg->Data[3] = 0x03; HAL_CAN_Transmit(&hcan, 10);