Timing requirements

Since the minidriver code is polled during the startup and kernel-initialization phases of the boot process, you need to know the timing of your device in order to verify if the poll rate is fast enough. Most of the time in startup is spent copying the boot image from flash to RAM, and the minidriver is polled during this time period. The sequence might look like this:

  • Call the minidriver.
  • Copy the next 16 KB.
  • Call the minidriver.
  • Copy the next 16 KB.
  • ...

The startup library contains a global variable mdriver_max, which is the amount of data (in bytes) that's copied from flash to RAM between calls to your minidriver. This variable is defined in mdriver_max.c, and its default value is 16 KB.

You might have to experiment to determine the best value, based on the timing requirements of your device, processor speed, and the flash.

In order to change this value, you can:

  • Copy mdriver_max.c to your specific board directory and then set the value. Be sure to recompile the libstartup.a library and relink your startup code with this new library.

    or:

  • Set the value in your startup's main() before you register the minidriver handler.
Page updated: