cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103-EVAL execute function from NOR

lonnie
Associate II
Posted on October 27, 2008 at 13:32

STM32F103-EVAL execute function from NOR

5 REPLIES 5
lonnie
Associate II
Posted on May 17, 2011 at 12:48

My goal is to have my main application that is stored in internal flash call a function stored in external NOR flash. What options do I have to accomplish this?

Looking at the STM32F103-EVAL board schematic, it seems the only way to program the NOR flash is via the STM32 itself, not by JLink. I was able to compile and run the FSMC NOR example, which demos erase/write/read operations with simple data.

The FSMC NOR_CodeExecute example requires that NOR be programmed with an external tool, which the STM32F103-EVAL doesn't support.

Has anyone successfully program NOR via the STM32 with a function and executed it?

Thanks in advance.

jj
Associate II
Posted on May 17, 2011 at 12:48

Enjoyed your post - just received my EVAL-E board today - will investigate and report.

Your issue has broader implications - perhaps this is a means by which those with ''special expertise'' can embed (and secure) their code w/in the STM32 and allow subsequent user-programmers to customize the functionality as they desire. Such capability may be of interest to those forum posters able to accept, ''not invented (entirely) here!''

youzou1981
Associate
Posted on May 17, 2011 at 12:48

Hi Lonnie,

You can use the DFU provided with ST USB package to program the NOR Flash.

You have to create a DFU file containg your function code.

Cheers,

Y1981

lonnie
Associate II
Posted on May 17, 2011 at 12:48

I was able to install the USB DFU on my PC and the required firmware on the dev board. I did successfully program and execute from NOR flash, but the DFU took over 15 minutes to program 128 mega bits. That seems excessive, maybe something is misconfigured.

I was also able to follow the NOR example and program NOR with executable code. In order to do this, I placed my function at a specific address in internal flash. I then copied that function to NOR using the WriteBuffer function provided with the NOR driver. In the ICF file I set the address of the function in internal flash using ''place address at''. I told the linker that I would initialize the function manually and to place the function into NOR memory area.

I'm using IAR build tools.

[ This message was edited by: lonnie.walker on 27-10-2008 18:02 ]

virtualfight
Associate II
Posted on May 17, 2011 at 12:48

Are you using one of the recommended Toolchains (RVMDK, EWARM, HITOP)? Then follow the instructions in the readme.txt located in the ''examples\FSMC\NOR_CodeExecute\binary'' folder.