Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-02

fpc-arm-embedded bin doesn't run

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

turro75

Hi All,

I'm trying to get the fpc working on a stm32f103c8 board (maple_mini_clone). following this http://j-software.dk/stm32f103.php
<http://j-software.dk/stm32f103.php> I'm able to compile (fpc-2.6.4) and flash the bin in the flash but no way to see the (damn) led to blink.... the code seems fine but i suspect something wrong at linking time.

Anybody can share something working i.e bin and pas file to verify my toolchain?

Turro

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpc-arm-embedded-bin-doesn-t-run-tp5720985.html Sent from the Free Pascal - General mailing list .
Jeppe Græsdal Johansen
to turro75

Den 17-02-2015 kl. 17:21 skrev turro75:

Show quoted text 12 lines
Hi All, I'm trying to get the fpc working on a stm32f103c8 board (maple_mini_clone). following this http://j-software.dk/stm32f103.php <http://j-software.dk/stm32f103.php> I'm able to compile (fpc-2.6.4) and flash the bin in the flash but no way to see the (damn) led to blink.... the code seems fine but i suspect something wrong at linking time. Anybody can share something working i.e bin and pas file to verify my toolchain? Turro

What command line did you use to compile the program with?

And how does your blink code look?

What version of binutils do you use?

turro75
to Jeppe Græsdal Johansen

Dear Jeppe,

Your job is awesome! Thanks for your effort on port fpc to stm32. Yesterday I found a way by using the 3.1.1, I was able to blink the led and visually debug the firmware through openocd (stlinkv2). This evening when I back to home I`ll explain better what I did.

Turro

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpc-arm-embedded-bin-doesn-t-run-tp5720985p5721035.html Sent from the Free Pascal - General mailing list .
turro75
to turro75

ok,

as I told in the previous post, I 'm now able to run and debug code with the trunk fpc (3.1.1).
I just made some minor changes in t_embed.pas in order to automatically create also the bin and call size.
Debugging works "fine" (not yet tested a complex program) with gdb --tui. Working in lazarus is fine just be sure to use -g only. Debugging using lazarus seems not possible until some changes in the IDE happen.

I'm in trouble now with the library stm32f103fw.pas since it expects some structures and variables not anymore defined in the rtl unit : SCB,NVIC and SysTick , I managed to create them in the file and then I'm able to compile and run a simple blink program. unfortunately I had to create my delay routine as interrupt wasn't working.

My problem now is that stm32f103fw.pas was probably made with 2.6.x when only four units were available,
anybody have an updated, almost complete library for stm32f103 ?

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpc-arm-embedded-bin-doesn-t-run-tp5720985p5721038.html Sent from the Free Pascal - General mailing list .
Mattias Gaertner
to turro75
Show quoted text 10 lines
ok, as I told in the previous post, I 'm now able to run and debug code with the trunk fpc (3.1.1). I just made some minor changes in t_embed.pas in order to automatically create also the bin and call size. Debugging works "fine" (not yet tested a complex program) with gdb --tui. Working in lazarus is fine just be sure to use -g only. Debugging using lazarus seems not possible until some changes in the IDE happen.

Have you tried debug type info dwarf?

Mattias

turro75
to Mattias Gaertner

Hi all,

I confirm that -gw2 works fine
-gl requires some unit ans inc file, if i copy them in the project directory it compiles but the resulting file it's too big.

Still struggling in visual debug.....no way with lazarus, I guess the only way is to write an openocd alternative which manage the lazarus gdbmi interface. Honestly this is over my knowledge.

At the moment i can use lazarus to write and compile, debug is done by gdb --tui as external tool.

Kdevelop looks promising as its template should allow to create something near lazarus.

Let's see.....

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpc-arm-embedded-bin-doesn-t-run-tp5720985p5721053.html Sent from the Free Pascal - General mailing list .