This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

StarterWare usb_host_msc example

Can someone tell me if building the usb_host_msc example without DMA_MODE defined is a valid build? We built the original example and it worked with a newer USB stick but using an older USB stick the code would hang waiting for dma tx to finish (cppi41dma.c line #1178). So we then built the example code without DMA mode being defined in the build and no matter what USB stick we use we get a processor abort when a LDRH instruction is used but the address is not on a 2 byte boundary (this happens while the code is in USBHMSCOpen().) So is the example only valid using the dma mode?

Thanks,

     John C.

  • It seems that our issues for non DMA_MODE involve unaligned memory access. Technical notes on ARM unaligned accesses state that they are only allowed to regions marked as Normal memory type, and support must be enabled by setting the SCTLR.A bit in the system control coprocessor. Does this example code for the beaglebone have these set and where would these be set?

    Thanks,

         John C.

  • It appears without the DMA_MODE set then the MMU will not be configured:

    #ifdef DMA_MODE
          MMUConfigAndEnable();
     
        /* Enable Data Cache */
        CacheEnable(CACHE_DCACHE);
    #endif  

    So without the MMU setup, the memory will fail when any unaligned access is made. So it seems this code was never run without DMA_MODE set. I should also note that even if call MMUConfigAndEnable() in non DMA_MODE, the example will not run as the error handling is not sufficient to decide that a device is not compatible and gracefully handle this condition.

    John C.

  • We always enable the MMU in our boot code. We then run something similar to the host example (w/o DMA) in one of the threads of our RTOS, so it can be made to work.

  •      For us we are currently not running an RTOS but once the MMU was set the older USB stick did work. Which RTOS are you running?

  • We run our own RTOS. It is on the order of complexity of something like FreeRTOS