Tool/software:
I am planning to reuse the BOOTP and TFTP functionalities from the EMACbootloader code in the code I am developing.When I directly reuse the BOOTPThread function and execute the SendBOOTPRequest function, it enters the FaultISR at the line pui8Packet[ui32Idx] = 0;
.
I suspect that modifying the value of uip_appdata
, which is declared in uip.h, is causing the fault. Is there a way to properly initialize uip_appdata
?
Also, I tried allocating memory at the beginning of SendBOOTPRequest() with uip_appdata = (uint8_t _)malloc(sizeof(uint8_t) _ UIP_APPDATA_SIZE);
, but the behavior did not change and it still enters the fault.
static void
SendBOOTPRequest(void)
{
uint8_t *pui8Packet = (uint8_t *)uip_appdata;
tBOOTPPacket *psBOOTP = (tBOOTPPacket *)uip_appdata;
uint32_t ui32Idx;
//
// Zero fill the BOOTP request packet.
//
for(ui32Idx = 0; ui32Idx < sizeof(tBOOTPPacket); ui32Idx++)
{
pui8Packet[ui32Idx] = 0;
}