原创 Something SPIFI

2012-2-17 18:30 1673 11 12 分类: 消费电子

Lately, I've been experimenting with the new LPC4350 dual-core microcontroller from NXP. It's quite an intriguing part, sporting a Cortex-M4 and a Cortex-M0. The former has floating point and DSP instructions, while the latter is targeted at the control and housekeeping functions that so many embedded systems need.


One interesting feature is their SPI Flash Interface (SPIFI). The company introduced this on their LPC1800 series of processors a year or two ago. SPIFI is a mechanism that interfaces the CPU to external serial flash memory. The cool thing is that the serial flash appears in the microcontroller's address space, and can be accessed in a standard random access fashion. That's right: random access to serial flash.


There are a number of upsides. Serial flash is cheaper than parallel. And, far fewer pins are needed. The SPI connection requires just four pins (6 for quad flash devices). A serial flash device can have just a total of 8 pins, greatly shrinking PCB real-estate needs. In contrast, parallel devices need gobs of address, data and control connections.


There's no software layer between the flash and the CPU. A SPIFI controller on-board the microprocessor connects the flash directly to the AHB bus (for some reason a lot of literature about ARM's Application High-speed Bus put the redundant word "bus" after AHB). Eight registers control the SPIFI interface; once set up, any instruction can access the flash as if it were regular memory. So the system can use serial flash as bulk storage, access it via DMA, and even execute code directly from it.


The LPC43xx series are very complex parts with tons of features. They do an initial boot from an on-board ROM, which can configure the SPIFI registers and then initiate the application's boot from SPIFI flash.


Being on the AHB means that either core can access the serial flash at any time. It's a little freaky using these parts since the M4 and M0 share address space. Either can use the same peripherals and memory. While this is a powerful idea, it's laden with reentrancy threats. There is an interprocessor communications strategy, though, so with a little care robust code isn't too hard to write.


The obvious down side is transfer speed. Real random-access reads and writes will be quite slow, as the address and data have to be transferred over SPI. That's probably not important for booting.


But one could copy the flash to RAM and execute from there. Block transfers are very fast. Some applications might take advantage of the on-board LCD controller, and store blocks of images in the flash, which will transfer quickly. The SPIFI controller can mediate these transfers so no CPU intervention is needed.


Presumably SPIFI will be an NXP-only feature, as the company is applying for a patent on the technology. But it's a pretty cool idea.


 

文章评论1条评论)

登录后参与讨论

用户1602177 2012-10-8 11:52

将来,人和机器,傻傻分不清楚咯~~

用户1406868 2012-8-20 07:54

Nice post. I used to be checking counutionsly this weblog and I am inspired! Very helpful info specially the last phase I deal with such info much. I was seeking this certain information for a very long time. Thanks and good luck.
相关推荐阅读
用户3671694 2016-04-18 17:49
What would you change about C?
If you’re an old-timer you’ve most likely written code in a large number of languages that have ma...
用户3671694 2016-04-18 17:33
A look at a new embedded heap manager
Many of us don’t give much thought about the math our compilers do. Toss off a call to a sine func...
用户3671694 2016-04-15 17:12
Why names are critical
The Linux printk function has various logging levels, which include KERN_EMERG, KERN_ERR and other...
用户3671694 2016-03-14 19:02
What do you think of ultra-low power watchdogs?
I have written extensively about designing ultra-low power systems that operate from coin cells. U...
用户3671694 2016-02-26 21:58
Comment headers: The best and the worst
I read a great deal of code. The vast majority is in C with some C++ and a bit of assembly sprinkl...
用户3671694 2016-02-12 17:58
What's your take on knobs?
In a recent Embedded Muse Richard Wall reviews the latest version of Digilent’s Analog Discovery U...
我要评论
1
11
关闭 站长推荐上一条 /2 下一条