ColdFire. MCF52223.  USB-FS memory access behavior.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ColdFire. MCF52223.  USB-FS memory access behavior.

Jump to solution
1,415 Views
Claude_Sylvain
Contributor I
Hello,

- I currently use the MCF52223 ColdFire and its integrated USB-FS peripheral,
  and noticed the following behavior:

    - When ColdFire is sending data over the USB as a device, the data
      buffer pointed to by the BDT must be in SRAM.  Putting that data
      buffer in Flash will make the USB-FS not working at all.

- It seems that there is no configuration register to make USB-FS able
  to access data buffer located in Flash.
  I configured "CFMSACC" to have "unrestricted" access to all Flash sectors,
  and this had no effect.

- Is it normal, or do am I missing something.



Claude Sylvain
Electro-Technica inc.

Labels (1)
0 Kudos
1 Solution
472 Views
mjbcswitzerland
Specialist V

Hi Claude

 

It is possible to send USB data content directly from FLASH but you need to use the backdoor address since the USB controller is a DMA master and not the CPU. You probably known that the USB controller also works with little-endian addresses so it is easy to add an automatic conversion to the backdoor address in the same step as follows:

 

extern void *fnLE_add_F(unsigned long long_word)       

                                                // convert to backboor address if the input address is not in RAM
{
    if (long_word < START_OF_SRAM) {    // if the address is in FLASH we use FLASH backdoor

                                                                            address to allow USB controller to access it
        long_word += BACKDOOR_FLASH;
    }
    return (void *)fnLE_add(long_word);   // perform big-endian to little endian conversion
}

 

 

See also: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

and http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF

 

Regards

 

Mark

 

 

www.uTasker.com
- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

 

View solution in original post

0 Kudos
2 Replies
473 Views
mjbcswitzerland
Specialist V

Hi Claude

 

It is possible to send USB data content directly from FLASH but you need to use the backdoor address since the USB controller is a DMA master and not the CPU. You probably known that the USB controller also works with little-endian addresses so it is easy to add an automatic conversion to the backdoor address in the same step as follows:

 

extern void *fnLE_add_F(unsigned long long_word)       

                                                // convert to backboor address if the input address is not in RAM
{
    if (long_word < START_OF_SRAM) {    // if the address is in FLASH we use FLASH backdoor

                                                                            address to allow USB controller to access it
        long_word += BACKDOOR_FLASH;
    }
    return (void *)fnLE_add(long_word);   // perform big-endian to little endian conversion
}

 

 

See also: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

and http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF

 

Regards

 

Mark

 

 

www.uTasker.com
- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

 

0 Kudos
472 Views
Claude_Sylvain
Contributor I

Thank you Mark,

 

All is clear now.

 

 

Claude

 

 

0 Kudos