cancel
Showing results for 
Search instead for 
Did you mean: 

STM32VLDISCOVERY Keil Assembly Project from Scratch

fj
Associate
Posted on June 28, 2013 at 05:44

I require to build an assembly project in the STM32VLDISCOVERY board either using Keil's  startup file (startup_stm32f10x_md_vl.s) or no startup file at all. The project must have either absolute (preferably) or relocatable assembly code, and if possible, the initial configuration should be apart from the main program. Unfortunately, there has been no success until now.

The following has been done:

1. Each of the  codes in the following links has been copied and pasted into a new file in an empty project:

https://my.st.com//public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Assembly%20Code%20Example

http://www.cs.uregina.ca/Links/class-info/301/ARM/lecture.html

http://www.keil.com/forum/22063/

The result is that the compiler throws the following warning: .\TEST0.sct(8): warning: L6314W: No section matches pattern *(InRoot$$Sections).

2. Trying to get rid of that warning, I made a ''mix'' of those codes, Keil's startup file (startup_stm32f10x_md_vl) and this video:

http://www.youtube.com/watch?v=Oy_cA1d6TqE

in the main.s file.

The result is that it still throws the same warning.

3. After that, the startup file was included in the project along with the main.s file.

The result is the following:

.\TEST0.axf: Warning: L6665W: Neither Lib$$Request$$armlib Lib$$Request$$cpplib defined, not searching ARM libraries.

 

.\TEST0.sct(7): error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.

The project after step 3 is attached. I would greatly appreciate if someone could help. Thanks a lot for your time.

#assembly-language #stm32vl-discovery
7 REPLIES 7
Posted on June 28, 2013 at 14:38

Attached

________________

Attachments :

TEST0.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzay&d=%2Fa%2F0X0000000bOD%2Fvn112g3bOZCTGLKOWQKWDd8Ht8WZnxqB.gzO95Ln7nc&asPdf=false
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
fj
Associate
Posted on June 28, 2013 at 15:58

Thanks a lot Clive. It works great!

But still, I want to ask, what did you modify to the project and why?

Thank you very much for your time.

Posted on June 28, 2013 at 16:21

I removed startup.s because it replicates the vector table. You will need to fill out the vector table in main.s more completely if you want to use the interrupts. You can cut-n-paste from the original startup.s file, but for purposes here I think all the WEAK links just clutter up the assembler,  especially when it's helpful to express a somewhat minimal solution.

I removed some code from main.s (heap, stack, and vector pointer) which I considered irrelevant in the context being used, ie you have no C code or runtime dependent on them, and you explicitly define the stack in RAM.

I changed the linker settings to use the scatter file, rather than create one each time from the Target dialog settings, and then I edited the .SCT file to remove the section references being complained about. It was only a warning, but as you have no code generating the section, and no prospect of using a library that might, I opted to remove it.

You will still need to turn on the clock for GPIOC in the AHB register in the RCC before you can program/use the peripheral.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
krishnapriya
Associate II
Posted on August 14, 2015 at 12:49

Hi,

I am using NUCLEOL152RE board.I have the same problem.

I'm still fairly new to Keil so this may be a very silly question but when trying to compile a project, I get the following error:

project.sct(7): error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.

This project is actually an example from STMicroelectronics so I'm hoping that the project itself is fine and that the error is simply from some configuration setting that I've missed up myself. I am attaching my folder.Could you please find out the error.

Thanks

Krishnapriya.

________________

Attachments :

x-cube-mems1.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzbX&d=%2Fa%2F0X0000000bOE%2FfrSmS312xFGYewramJ1IRbxX0p1XSbRzWTt6h_dtTug&asPdf=false
Posted on August 14, 2015 at 17:12

Wow this is just so off-topic. The datalog and freefall project both build fine with uv5.15 here, doesn't appear to be any user code/project within the archive.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
krishnapriya
Associate II
Posted on August 15, 2015 at 16:37

Hi,

I already attached the project in the previous message.The user code path is :

x-cube mems 1\STM32CubeExpansion_MEMS1_V1.3.0\Projects\Multi\Examples\DataLog\MDK-ARM\STM32L152RE-Nucleo.

When i am exporting this project to mdk-arm it showing error.

project.sct(7): error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.

Kindly help to resolve this error.Thanks for your valuable time.

Thank you

Krishnapriya

Posted on August 15, 2015 at 18:14

I already attached the project in the previous message.

And I responded that both projects build without error on my system, and appear to be stock example projects. You should perhaps reflect about what wrong with your system, and provide salient details of the OS, and tool versions, etc. ie Stuff that might identify why it's not working for you.

I built them with uv5.15 on a Win 7 x64 system, Keil had both Cortex and ARM7/9 Legacy packs installed.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..