I have a custom boot-loader at 0x0021-0000 and an app at 0x0024-8000. The app is approximately 0x10000 long. When flash down-loading, with the custom boot-loader, a small block of 44 32-bit words is corrupted. Trapping on that packet, it appears that they are corrupted in the USB buffer. It repeatable in the same place every time. Wireshark & console monitor shows that the Windows app is sending the correct data.
The custom-user-boot-loader makes calls to FlashMainPageProgram() in the foundation firmware, which really calls programming functions in ROM. I disable interrupts before the FlashMainPageProgram() call and enable them after. I found that if I left the interrupts enabled I ran into more issues.
The TI M3 allows running out of flash while programming flash. However, it really does not make clear what the policy is on having interrupts enabled during this flash programming is! It would seem to me that as long as the interrupts only make calls to the custom boot-loader area, it should not be a problem. But, that is not the case.
The reason I mention this is that perhaps there is some timing issue, where the USB cannot service interrupts at a critical point with the PC. However, this would be limited to just control messages as the actual boot-loader communications are poll-response. That is, data is sent to the 2538, the 2538 turns of interrupts, programs the data, and then sends back a status. The data programmed is small packets of 100 (decimal) so it is fairly quick. Oddly, I don't have an issue on the initial erase where many blocks are erased and it takes several seconds. The USB packets that come in right after that are fine.
It may not be related to interrupts at all. But this describes what is procedure is.
Any ideas?