Hello, I'm having trouble writing to flash memory using the C40 chip in the bootloader. I'm writing a 300KB binary program, and it frequently fails at the 9th data packet (the second block), with only a 1/10 chance of succeeding completely. Could you please check if there's a problem with my C40 chip? The main program I'm writing...
Flash_UnlockSectorIfProtected ( cur_sector ) ;
DisableAllInterrupts () ;
DisEnableIrq1 () ;
if ( Flash_Write ( flash_write_addr + offset , & payload [ 2 ] , FIXED_PACKET_DATA_LEN ) != 0 ) {
EnableIrq1 () ;
EnableAllInterrupts () ;
}
EnableIrq1 () ;
EnableAllInterrupts () ;
Is there a problem with my use of Power_Ip_MC_ME_SocTriggerResetEvent(POWER_IP_DEST_RESET_MODE) for resetting? How can I prevent consecutive resets after 8 attempts, and what function should I use for jumps?
func = * ( uint32_t volatile * )( ADDR_APP + 0xC ) ;
func = * ( uint32_t volatile * )((( uint32_t ) func ) + 0x4 ) ;
func = (((( uint32_t ) func ) & 0xFFFFFFFF U )) ; // Reset_Handler+1 --> required to avoid hard fault
After resetting and jumping , will there be any residual data from the previous program? Is it necessary to clean up the RAM? If so , how? Thank you .
Hi@ LJH1
Please provide me with a simple demo that can reproduce the problem so I can reproduce your issue. I don't need your complete product project or scattered driver files.
RTD Company uses version 4.0.0 as standard.