This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

trigger the execution via USB

I am using MCB2300 kit with LPC2378 processor. I had a look at the example provided in C:Keil\ARM\Boards\Keil\MCB2300\RL\USB_FlashFS . Here SD Card as storage media for USB memory. I am doing some processing on the files present on SD card via USB interface. Now I need to trigger the file processing the moment a file with a specific name is created on SD card instead of me typing the command on the serial window along with the file name for doing processing. Please let me know how to trigger this?

Parents
  • I definitely recommend the CDC (or similar) route, where the embedded system gets a stream of data and ot its own writes it to the file system and then processes the data.

    Look at it the other way. If the embedded system exports a file system to the PC, but itself also wants to read files, then your embedded device is a multi-user file server, supporting concurrent file accesses.

    How do you synchronize such accesses between the PC and the embedded program? In truth - you can't without disconnecting from USB to claim ownership. Any other solution is a hack that requires you to have internal knowledge about the OS (or at least file system) implementation in the embedded unit, and the behaviour of the program on the PC who writes data.

    Streamed, or pipelined, servers are the easiest way. The consumer (receiver) can decide if it should wait for low CPU load before starting to process data. Or wait until it has x kB unprocessed. Or it may process data on-the-fly. And it can send confirmations or errors back to the PC based on available file space, or acceptable format of transmitted data or whatever other attribute that is important to you.

    But never implement a multi-user file server unless you need to - who would care about file locks if no program knows that it should lock file sections? What program - or OS - would expect a USB-connected memory device to require file locking?

Reply
  • I definitely recommend the CDC (or similar) route, where the embedded system gets a stream of data and ot its own writes it to the file system and then processes the data.

    Look at it the other way. If the embedded system exports a file system to the PC, but itself also wants to read files, then your embedded device is a multi-user file server, supporting concurrent file accesses.

    How do you synchronize such accesses between the PC and the embedded program? In truth - you can't without disconnecting from USB to claim ownership. Any other solution is a hack that requires you to have internal knowledge about the OS (or at least file system) implementation in the embedded unit, and the behaviour of the program on the PC who writes data.

    Streamed, or pipelined, servers are the easiest way. The consumer (receiver) can decide if it should wait for low CPU load before starting to process data. Or wait until it has x kB unprocessed. Or it may process data on-the-fly. And it can send confirmations or errors back to the PC based on available file space, or acceptable format of transmitted data or whatever other attribute that is important to you.

    But never implement a multi-user file server unless you need to - who would care about file locks if no program knows that it should lock file sections? What program - or OS - would expect a USB-connected memory device to require file locking?

Children
No data