Recent

Author Topic: Resources for STM32  (Read 2277 times)

petex

  • Jr. Member
  • **
  • Posts: 69
Resources for STM32
« on: January 14, 2021, 09:51:27 am »
hello,
I am looking into using FPC/Laz to cross compile for the STM32 card. The Arduino IDE provides a lot of in-built libraries and code examples but it is not Pascal. To me, the STM32 "blue pill" is really cheap and powerful and sits in a gap between the 8 bit PIC and the Pi.

The Ultibo project looks really good and a similar thing for Arduino cards would be nice. I have used Lazarus on the Raspberry PI and that works well. I have used Mickroelectonika Pascal on the PIC16F628 and that works really well.

One of the first things I would want to do in my experimentation is read/write to the usart. I guess a lot of this basic stuff has been done before. Are there any links to such libraries available ?
Looking through the other posts here it also seems that linking to C code can be problematic as well.

I have looked around for websites/blogs about using Lazarus with Arduinos and its quite sketchy. I haven't found much in the WIKI either.

I am also looking for examples on writing an interrupt handler in this environment.

I am guessing that there is no integrated debugger available.

MiR

  • Full Member
  • ***
  • Posts: 246
Re: Resources for STM32
« Reply #1 on: January 14, 2021, 09:57:48 am »
Re-check the forum posts, there is a list of Ressources for programming embedded targets and also threads about debugging from within the ide.
Linking to C-code also works pretty well, I know of people that actually link to the Arduino C-Libs for SAMD51 chips and I myself link to FreeRTOS and some debugging tools without issue.

MiR

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Resources for STM32
« Reply #2 on: January 14, 2021, 10:01:46 am »
One of the first things I would want to do in my experimentation is read/write to the usart. I guess a lot of this basic stuff has been done before. Are there any links to such libraries available ?

You can take a look at the Microcontroller Board Framework. It seems to support STM32 in general, though I don't know whether it supports your specific board.

Looking through the other posts here it also seems that linking to C code can be problematic as well.

C code is usually not the problem. But Arduino is mostly (simple) C++ and that is problematic.

I have looked around for websites/blogs about using Lazarus with Arduinos and its quite sketchy. I haven't found much in the WIKI either.

So you didn't find this or more in general this?
« Last Edit: January 14, 2021, 03:09:06 pm by PascalDragon »

petex

  • Jr. Member
  • **
  • Posts: 69
Re: Resources for STM32
« Reply #3 on: January 14, 2021, 10:21:37 am »
Quote
So you didn't find this or more in general this?

Yes I did. I followed the instructions but had the problems on my previous post.

dseligo

  • Hero Member
  • *****
  • Posts: 1194
Re: Resources for STM32
« Reply #4 on: January 14, 2021, 11:25:54 am »
You have wrong link here, I fixed it:
So you didn't find this or more in general this?

MiR

  • Full Member
  • ***
  • Posts: 246
Re: Resources for STM32
« Reply #5 on: January 14, 2021, 11:39:05 am »
When I am honest I must say that the documentation on Wiki is good, but it mostly scratches the surface for stm32, it is more in-depth for AVR

More Info can actually be found here in the Forum, like for example info on this stm32f103 specific library that was used in the thread about DMA (The thread actually covers UART and interrupts when I remember correctly).

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Resources for STM32
« Reply #6 on: January 14, 2021, 03:09:42 pm »
You have wrong link here, I fixed it:
So you didn't find this or more in general this?

I've now fixed it in my post as well. Thank you... :-[

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Resources for STM32
« Reply #7 on: January 14, 2021, 03:25:15 pm »
When I am honest I must say that the documentation on Wiki is good, but it mostly scratches the surface for stm32, it is more in-depth for AVR

In fairness, there's been a lot of people working on understanding the AVR family largely because of the Arduino's popularity. They've been helped by the fact that there's a lot of commonality in control registers and peripherals across the range, and that not having an OS most AVR boards make it pretty obvious when something's not quite right (none of this "is the hardware not doing what I want or have I got the API parameters wrong?").

While ARM chips have been round for decades and have been fairly accessible since the days of the NSLU2 "Slug" and various "smart plugs" etc., the STM32 with its particular mix of control registers is much more recent and has attracted /relatively/ little attention.

In both cases I miss the simplicity of being able to attach a logic analyser onto the system bus, but that's another issue entirely.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Resources for STM32
« Reply #8 on: January 14, 2021, 09:19:15 pm »
When I am honest I must say that the documentation on Wiki is good, but it mostly scratches the surface for stm32, it is more in-depth for AVR

More Info can actually be found here in the Forum, like for example info on this stm32f103 specific library that was used in the thread about DMA (The thread actually covers UART and interrupts when I remember correctly).

It would be helpful if you could transfer any useful STM32 info to the Wiki for future travellers to make their journeys easier.

 

TinyPortal © 2005-2018