I'm need to do a USB stick Data Logger.
I'm using MQX 4.2 and CodeWarrior 10.6 for that. The MCU used here is a MK70FN1M0. And I'm using TWR-K70 for development.
Initially, I'm trying to mount a FAT file system, open a pre-created .txt file and write a string to it every second just as a test.
I took the mfs_usb_twrk70f120m demo from MQX 4.2. In USB_task, I set a lw_event after the interface is detected the file system is mounted:
I also cleared the same event if the USB memory stick is dettached, as well.
I created a new task to wait for this event, open a pre-created .txt file, and write a string to it, and close the file, every second.
As you can see in the image bellow, the event is set, but it looks like the file cannot be opened in the USB memory stick for a reason that I don't know yet.
Where did I go wrong?
Can anybody help me on this, please?
Thanks and best regards,