K70 external ram simple question

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

K70 external ram simple question

跳至解决方案
1,723 次查看
James8
Contributor I

Hi, I'm looking at using a K70 for a new project but having never used external ram in any embedded project before, I just have a simple question... once all the registers and what-not are set up, can the memory be used just like internal SRAM? i.e. completely transparently from the C code's point of view:

 

void foo(uint32_t * p)
{

*p = 0;

 

foo(sram_pointer);

foo(dram_pointer);

 

as oppose to say having to use some compiler extension like "unsigned int far *" or needing to use registers in order to actually read/write to the memory.

 

Are there any restrictions you think I might need to know about?

 

Thanks

0 项奖励
回复
1 解答
1,281 次查看
konrada
Contributor IV

External RAM can be used like internal RAM; it lies in the same 32-bit flat address space. Things to look out for:

  • External RAM is slower => need to enable cache =>  need to flush/disable cache when dealing with DMA buffers
  • Debugger support is more adventurous. If your debugger and JTAG adapter work fine with internal RAM, that doesn't mean it will work fine with external RAM (e.g. can't read/write ext ram from debugger, can't put breakpoints on external RAM addresses). However, that's more a problem of immaturity of Kinetis tooling, and time is working for you. 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,282 次查看
konrada
Contributor IV

External RAM can be used like internal RAM; it lies in the same 32-bit flat address space. Things to look out for:

  • External RAM is slower => need to enable cache =>  need to flush/disable cache when dealing with DMA buffers
  • Debugger support is more adventurous. If your debugger and JTAG adapter work fine with internal RAM, that doesn't mean it will work fine with external RAM (e.g. can't read/write ext ram from debugger, can't put breakpoints on external RAM addresses). However, that's more a problem of immaturity of Kinetis tooling, and time is working for you. 
0 项奖励
回复
1,281 次查看
James8
Contributor I

Cool, thanks.

 

I have a Jlink Ultra which at least claims to support external RAM, so I guess we'll see.

 

0 项奖励
回复