fpc-arm-embedded bin doesn't run

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

fpc-arm-embedded bin doesn't run

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 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
Reply | Threaded
Open this post in threaded view
|

Re: fpc-arm-embedded bin doesn't run

Jeppe Johansen-3
Den 17-02-2015 kl. 17:21 skrev 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
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?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fpc-arm-embedded bin doesn't run

turro75
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
Reply | Threaded
Open this post in threaded view
|

Re: fpc-arm-embedded bin doesn't run

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 ?
Reply | Threaded
Open this post in threaded view
|

Re: fpc-arm-embedded bin doesn't run

Mattias Gaertner
On Wed, 18 Feb 2015 16:02:53 -0700 (MST)
turro75 <[hidden email]> wrote:

> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fpc-arm-embedded bin doesn't run

turro75
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.....