ColdFire. MCF52223.  USB-FS memory access behavior.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ColdFire. MCF52223.  USB-FS memory access behavior.

跳至解决方案
1,609 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
666 次查看
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 项奖励
回复
2 回复数
667 次查看
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 项奖励
回复
666 次查看
Claude_Sylvain
Contributor I

Thank you Mark,

 

All is clear now.

 

 

Claude

 

 

0 项奖励
回复