Hi Folks,
I started porting USB Mass Storage library for STM32F107 and I am hitting with an issue... I am hitting with a hardFault in the library when the data into incoming EP(EP1) is copied into it's FIFO. OTGD_FS_WritePacket is called from ISR. Not sure why i am getting hit with the ASSERT at the step that I have highlighted in the below code.
USB_OTG_WRITE_REG32( fifo, *((__packed uint32_t *)src) );
Did any one hit with such an issue? This issue is blocking me. Any one please help with this?
USB_OTG_Status OTGD_FS_WritePacket(uint8_t *src, uint8_t ep_num, uint16_t bytes)
{
USB_OTG_Status status = USB_OTG_OK;
uint32_t dword_count = 0 , i = 0;
__IO uint32_t *fifo;
/* Find the DWORD length, padded by extra bytes as neccessary if MPS
* is not a multiple of DWORD */
dword_count = (bytes + 3) / 4;
fifo = USB_OTG_FS_regs.FIFO[ep_num];
for (i = 0; i < dword_count; i++, src += 4)
{
USB_OTG_WRITE_REG32( fifo, *((__packed uint32_t *)src) );
}