Author Topic: Want to get started with ARM stm32  (Read 29210 times)

0 Members and 1 Guest are viewing this topic.

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6459
  • Country: nl
Re: Want to get started with ARM stm32
« Reply #50 on: January 27, 2015, 01:29:22 pm »
Quote
except the I2C peripheral
Yeah. Well known and well documented. Someone at ST should be canned for that.
Ok mistakes do happen but to keep the *(&^*&^*& peripheral with all the bugs as is in all newer releases is ... is ....  (I have no words for it)  :palm:
ST: FIX IT! or buy the I2C peripheral from NXP  ;D .
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Want to get started with ARM stm32
« Reply #51 on: January 27, 2015, 01:45:27 pm »
Some people have mentioned here debugging with "well placed printf...".. Oh boys, come on... have you ever debugged any serious stuff?   ;D

Printf debugging (via SWO or UART or anything) is indeed helpful, but that only helps with software algoritmization issues. When it comes to fiddling with peripherals, printf becomes useless.

One nice and easy way for learnig how peripherals work, is just to take the debugger and play with the bits. Most peripherals can be learnt that way.. like RTC, ADC, USART, SPI, I2C (on the above mentioned F0 it should work fine)... And learning ARMs is mostly about the complex peripherals (NXP fanboys doesn't understand that, their peripherals are pretty straight)  ;D

dannyf: That's all about the ST's marketing people.  StdPeriph was good, but the headquarters decided to abanon that, just because it is old (and maybe to much hard to use for arduino whiners - so more arduinistic library must have been made).  Simply, marketing and engineering do not mix.  :-// :-)
« Last Edit: January 27, 2015, 01:48:05 pm by Yansi »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Want to get started with ARM stm32
« Reply #52 on: January 27, 2015, 01:53:57 pm »
Quote
Printf debugging

SWO is infinitely better than printf.

RTT is infinitely better than SWO.

J-Scope is infinitely better than RTT.

As is FreeMaster.

That should give you some sense how last-millennium "printf() debugging" is.
================================
https://dannyelectronics.wordpress.com/
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: Want to get started with ARM stm32
« Reply #53 on: January 27, 2015, 02:10:40 pm »
You should take a look at the datasheets to get a sense as to how doable such an approach is to you.

+1

OP, being able to interpret vendor's documentation and examples is a very valuable skill and is doable. Start with a canned hello world and start digging one peripheral at a time. I did it recently switching from atmega328p to lpc11u35 and it's just the same, a bunch of registers that you need to manipulate based on vendor's documentation. If you hit a snag, search the internet or ask. Time and patience are your friends.
 

Offline Mechanical Menace

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: gb
Re: Want to get started with ARM stm32
« Reply #54 on: January 27, 2015, 04:44:00 pm »
Quote
Printf debugging

SWO is infinitely better than printf.

RTT is infinitely better than SWO.

J-Scope is infinitely better than RTT.

As is FreeMaster.

And for a lot of things they are overkill and printf or printk or whatever equivalent you have available works great , especially over a serial connection. Yes there are plenty of cases where you want a fully fledged debugger but for begginers if they NEED one they don't understand their code good enough to be able to use one.


And if you think printf is sooo last millennium you wouldn't like my use of command monitors, and I guess we should give up on fire no matter how well it works because that's so mesolithic :P
Second sexiest ugly bloke on the forum.
"Don't believe every quote you read on the internet, because I totally didn't say that."
~Albert Einstein
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Want to get started with ARM stm32
« Reply #55 on: January 27, 2015, 06:30:20 pm »
Quote
And for a lot of things they are overkill and printf or printk or whatever equivalent you have available works great , especially over a serial connection. Yes there are plenty of cases where you want a fully fledged debugger but for begginers if they NEED one they don't understand their code good enough to be able to use one.

This is utter garbagge nonsense.  :wtf:

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: Want to get started with ARM stm32
« Reply #56 on: January 27, 2015, 06:37:19 pm »
Quote
And for a lot of things they are overkill and printf or printk or whatever equivalent you have available works great , especially over a serial connection. Yes there are plenty of cases where you want a fully fledged debugger but for begginers if they NEED one they don't understand their code good enough to be able to use one.

This is utter garbagge nonsense.  :wtf:

It's OK to disagree but no need to be rude. It doesn't reflect well on you and you cause.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Want to get started with ARM stm32
« Reply #57 on: January 27, 2015, 07:03:35 pm »
That wasn't meant to be rude. But after a few pages of this thread, talking about the complexity of ARM peripherals, someone suggests using printf-style debugging, for a beginner?! With the excuse of "otherwise he doesn't understand his code"?
Sorry, but that really is a pure nonsense.

Beginner should just have resources to get that insight, what he's doing. With a printf, he get's nothing, because beginner even couldn't know how to redirect the putchar to UART or somewhere else.

Or why do you think, almost every average university teaches MCU programming with a simulator and/or debugger instead of "printf"?
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: Want to get started with ARM stm32
« Reply #58 on: January 27, 2015, 07:32:24 pm »
Beginner should just have resources to get that insight, what he's doing. With a printf, he get's nothing, because beginner even couldn't know how to redirect the putchar to UART or somewhere else.

Or why do you think, almost every average university teaches MCU programming with a simulator and/or debugger instead of "printf"?
+1
The printf..ing and programmer are of little use when you have a debugger.. Nowadays, (unless you pick Atmel who still charges >$50 for that), the full-featured debuggers are give-aways.
Printf..ing could be used for some tasks like logging or when your target is at remote location and you simply cannot connect JTAG with 100m usb wire to it. Of course programmers also have their niche on a production lines where you just need to flash zillions of uC one by one.

But during the development the ability to stop the target on selected trigger, to sniff the ram content, analzyze the stack, step through the code, dump some array and substitute with another one is invaluable..

« Last Edit: January 27, 2015, 08:21:02 pm by Brutte »
 

Offline hydrabus

  • Contributor
  • Posts: 13
  • Country: fr
    • HydraBus open source multi-tool hardware
Re: Want to get started with ARM stm32
« Reply #59 on: January 27, 2015, 07:38:07 pm »
That wasn't meant to be rude. But after a few pages of this thread, talking about the complexity of ARM peripherals, someone suggests using printf-style debugging, for a beginner?! With the excuse of "otherwise he doesn't understand his code"?
Sorry, but that really is a pure nonsense.

Beginner should just have resources to get that insight, what he's doing. With a printf, he get's nothing, because beginner even couldn't know how to redirect the putchar to UART or somewhere else.

Or why do you think, almost every average university teaches MCU programming with a simulator and/or debugger instead of "printf"?

Printf is not always the best for embedded debugging especially for problems with timing and can even be the cause of crash in some cases.

So I recommend to use a debugger with SWD/JTAG and Em::Blocks which support it natively which can be used to checks peripherals too ...

Also for critical routines debugging (like hw protocol spi/i2c/uart/gpio...) an oscilloscope and/or a logic analyzer is a must have (to check timing of part of the code switching a GPIO ON/OFF is very good practice too).

Before to debug with JTAG/SWD build the code in "Debug" mode (-O0 -g3) else it's very hard to execute code step by step with optimized code as it does not correponds to C code in lot of cases.

Best Regards
Benjamin
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: Want to get started with ARM stm32
« Reply #60 on: January 27, 2015, 07:39:38 pm »
That wasn't meant to be rude. But after a few pages of this thread, talking about the complexity of ARM peripherals, someone suggests using printf-style debugging, for a beginner?! With the excuse of "otherwise he doesn't understand his code"?
Sorry, but that really is a pure nonsense.

It's not 'really', it's your opinion. 

I have a debugger in the drawer and didn't touch it for example when writing recently a SPI driver.

There is more than one way to skin a cat.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Want to get started with ARM stm32
« Reply #61 on: January 27, 2015, 08:10:37 pm »
Sure, every beginner can write SPI driver on STM32, without debugger and without previsous experience with such thing...

Am I in some parallel universe? Or dumb enough that I spend my time talking with people, who think debugger is not necessary piece of equipment for a beginner? Maybe both...   

I think I'm done here.  :(
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4069
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Want to get started with ARM stm32
« Reply #62 on: January 27, 2015, 09:52:18 pm »
The discussion to debugger to not to debugger has already been conducted on this forum. Somewhere...

A debugger gives you:
- Data snapshots.
- Live assembler.
- Access breakpoints! ( when your pointer kung-fu is failing )
- Tracepoints (if you pay)
- Logic analyzer (if you pay)

A well placed printf gives you:
- Real time, non-invasive status display of the program(s)
- An indication on where to throw your breakpoints.
- Fault handler data in a human readable form.
- Asserts (aka, your mistakes)
More helpful with proper tooling, https://github.com/Jeroen6/MultiTerminal

People should figure out if the debugger is helpful for themselves.
It's not worth a discussion imho.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Want to get started with ARM stm32
« Reply #63 on: January 28, 2015, 01:07:40 am »
Am I in some parallel universe? Or dumb enough that I spend my time talking with people, who think debugger is not necessary piece of equipment for a beginner? Maybe both...

Probably neither. Maybe just dumb enough to think a beginner can benefit at all from the complexity of a debugger let alone need one to learn. Or more likely too smart to see the truth.

Internet hotshots fall into two categories: those who honestly forgot what starting out is really like. And then there's those who generally just want to show off how smart they are and not so much out to help noobs. They do pretend though.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6459
  • Country: nl
Re: Want to get started with ARM stm32
« Reply #64 on: January 28, 2015, 10:25:06 am »
Yep personally I use them both whenever they are most suited and I do use another one: a PC.
The PC with c compiler I use for debugging / rigorously testing algorithms or complex c routines (KAT testing), all above the HAL ofcourse, below the HAL the PC is useless.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf