12/14/2023 0 Comments Usb block serial number![]() This also works 100% for protecting the data logging side, but USB written files are heavily corrupted. ![]() Same principle used in say a USB to serial converter, when the UART TX buffer is full. I also need a bit of a delay to avoid data corruption on the USB VCP which is used for debugs not surprising.Īnother method is for the data logging side to set a flag when using SPI, and when the USB ISR sees this, it returns USBD_BUSY (instead of USBD_OK) and stays out of the SPI. The Windows host is fine with that - so long as I delay about 10ms after each FLASH page write (during logging) to give USB a chance to get in. USB ints are potentially disabled for 1 FLASH page write which is 18ms. I am assuming they are fully readable.īoth methods work equally: 100% for protecting the data logging side but there is a tiny chance of USB accesses (file writes, 2MB files) getting corrupted probability is around the PPM level but not zero, and only if there is heavy data logging FLASH usage. ![]() I have tried disabling USB interrupts, via one of these methodsĪnd restoring these registers after SPI is finished. Another part of the FLASH is for data logging etc usage.Īll this is working, but the ISR which implements the USB block device must be blocked out of the SPI function during data logging, obviously, otherwise it could jump in during one of the data logging accesses the SPI and the FLASH are obviously not re-entrant! I have a serial FLASH, a part of which implements a Windows file system (removable block device).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |