Coder Social home page Coder Social logo

Comments (7)

OliviliK avatar OliviliK commented on June 28, 2024

Tom,
You are ahead of me in this. By inspecting the LOCM3 make files, I did realize that we are missing some functionality in EmBitz to populate the handlers for LOCM3.

In past, I have been using Standard Peripheral Library as the default by EmBlocks/EmBitz. That was working without any issues.

As you have observed, the Wiki has been in hold due to uncertainty of LOCM3 future. I do expect the Unicore-Mx to be an alternative, but it is not yet ready for prime time. The two other alternatives for EB libraries are CubeF1/F4/F7/L4 and ChibiOs/RT/NIL/HAL. As you know, SPL is not available for F7.

from stm32f103.

AAATom avatar AAATom commented on June 28, 2024

Hi Olavi,
thanks for getting back to me.

I have the SPL and even STM32CubeMX ISR code working in EmBitz too.
The code from STM32CubeMX initialization code generator worked without touching the files, just had to tweak two options for linker and assembler (apart from setting Build options to be the same as in a project generated by EmBitz for the same MCU. The .l file generated by STM32CubeMX worked just fine.

That makes me wonder what is wrong with the linking process for LOCM3 ...

from stm32f103.

FTC11292 avatar FTC11292 commented on June 28, 2024

If you look the blog link in the Wiki, there you have a description of the step 4.1, which was not working in my MinGW environment in W10. Perhaps the make file works properly in genuine Linux platform. That step 4.1 handles the interrupt setup process.

I am afraid that I don't have good answers for this.

from stm32f103.

AAATom avatar AAATom commented on June 28, 2024

I'm running all this on Windows 7 VM (still deciding which environment I'll use) and had no problems with the process.
The files look good, even the resulting map file seems to have all the symbols there (I did not go into detailed checking, though). As I said, it looks like a linker issue.

I hoped to get jump-started with STM32F103 development for my (private) side project since I found quite a lot of useful examples using LibOpenCM3. As I haven't managed to get any of them working (apart from simple LED-blinking) I've turned back to good old start-from-scratch way I always handled embedded development.
The STM32CubeMX looks the way to go.

Oh, and EmBitz is the only free IDE with debugging that worked out-of-the box so far.

from stm32f103.

AAATom avatar AAATom commented on June 28, 2024

Seems that the problem is in the "startup_stm32f10x_md.S" file which populates the vector table with symbols that are not tied to C/C++ symbols.
For example, the SysTick_Handler symbol is defined in LibOpenCM3's "core_cm3.h" file as #define SysTick_Handler sys_tick_handler but that does not define it for the linker - and linker then uses SysTick_Handler defined by def_irq_handler macro in the "startup_stm32f10x_md.S" file.

Simply renaming void sys_tick_handler(void) to void SysTick_Handler(void) solves the problem.

To fix this I added #include <irqhandlers.h> (which contains only #define's of IRQ handler alternative names) to "startup_stm32f10x_md.S" file and added another search path to the project options (C:\CommonLibs\libopencm3\include\libopencmsis\stm32\f1) - but I also had to add #define SysTick_Handler sys_tick_handler to make it pass assembly (because it is not defined in "irqhandlers.h" for some reason).

Now it works.

Is this the right way to do it?

from stm32f103.

OliviliK avatar OliviliK commented on June 28, 2024

Tom,

You have done an excellent detective work. Without knowing all the backgrounds, this seems to be the explanation and you have solved the problem. Thanks for sharing your observations.

from stm32f103.

AAATom avatar AAATom commented on June 28, 2024

You are welcome, Olavi!

from stm32f103.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.