Commit ec9155c9784ee9bd91c9179a1fd3d9ca8f963cd3
1 parent
e89ead9a
Fix problem with enabling MSD on some CM / CM3 devices
Showing
3 changed files
with
5 additions
and
3 deletions
main.c
| ... | ... | @@ -227,6 +227,8 @@ int second_stage_boot(libusb_device_handle *usb_device) |
| 227 | 227 | { |
| 228 | 228 | int size, retcode = 0; |
| 229 | 229 | |
| 230 | + sleep(1); | |
| 231 | + | |
| 230 | 232 | size = ep_write(&boot_message, sizeof(boot_message), usb_device); |
| 231 | 233 | if (size != sizeof(boot_message)) |
| 232 | 234 | { |
| ... | ... | @@ -242,7 +244,7 @@ int second_stage_boot(libusb_device_handle *usb_device) |
| 242 | 244 | return -1; |
| 243 | 245 | } |
| 244 | 246 | |
| 245 | - sleep(1); | |
| 247 | + usleep(125); | |
| 246 | 248 | size = ep_read((unsigned char *)&retcode, sizeof(retcode), usb_device); |
| 247 | 249 | |
| 248 | 250 | if (size > 0 && retcode == 0) |
| ... | ... | @@ -254,6 +256,8 @@ int second_stage_boot(libusb_device_handle *usb_device) |
| 254 | 256 | printf("Failed : 0x%x", retcode); |
| 255 | 257 | } |
| 256 | 258 | |
| 259 | + sleep(1); | |
| 260 | + | |
| 257 | 261 | return retcode; |
| 258 | 262 | |
| 259 | 263 | } |
| ... | ... | @@ -494,10 +498,8 @@ int main(int argc, char *argv[]) |
| 494 | 498 | printf("Second stage boot server\n"); |
| 495 | 499 | file_server(usb_device); |
| 496 | 500 | } |
| 497 | - libusb_reset_device(usb_device); | |
| 498 | 501 | |
| 499 | 502 | libusb_close(usb_device); |
| 500 | - sleep(5); | |
| 501 | 503 | } |
| 502 | 504 | while(loop || desc.iSerialNumber == 0); |
| 503 | 505 | ... | ... |
msd/bootcode.bin
No preview for this file type
msd/start.elf
No preview for this file type