Best way to dive into ARM development
RobsonCouto wrote 04/27/2016 at 22:06 • 2 pointsHi, I'm Robson.
I had my first contact with microcontrollers with Arduino. It was cool and all, but I knew that to know more I had to go deeper. I started to learn AVR C with Atmel Studio and today I can do one thing or another. I also had a bit of PIC assembly in college.
8 bit is awesome, but I comprehend that sometimes is necessary more power. I have been trying to learn ARM, but you can't find good material as easy as it happens with AVR. While in my exchange program I had the opportunity to learn about the ARM architecture and assembly( 32 bit ARM7TDMI), but we used KEIL and some pre compiled library. A good experience indeed, but not enough.
I am aware that ARM microcontroller generally don't use the regular ARM instruction set and are somehow different.
I have a STM32F103C8T6 board from ebay. And another board with a NXP1114.
What I want specifically?
- A reference of compiler or environment (I didn't like KEIL). I am a windows user but have Linux installed.
- A reference of microcontroller family (is it stm32 good already?).
- examples, tutorials, series that may have helped you or that you produced.
That is what I can remember. Thanks in advance!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hey Rodson,
From 1 Newb to the other, I personally have just started in Embedded Systems Designs, I know all too well how frustrating it can be getting started with these ARM 32 bit micro-controllers but thankfully i had a good mentor to help me through it all. Firstly SWD stands for Serial Wire Debug and its just another means to communicate with the controller(program/debug). For now i don't think it essential to dive that deeply into the topic, mostly what you want to know are the pin assignments.
A good IDE, well if you are planning on going with the STM32 family among others is Rowley Crosswork. Got introduced to in my line of work and its been a blast, easy to use and to get familiar with the different tools it offers. It has a free version which provides u with 16kb of program memory with i think would work just fine for you since you haven't yet delve into the world of RTOS. There are others such as IAR, Eclipse and System workbench(Based on Eclipse) by ST if you want to experiment a bit, but personally i prefer Crossworks . That said ST micro provides a nice lineup of products for you to get started including demo board such as the Nucleo series and some nifty development tools such as the ST CUBE software that allows easy generation and configuration of startup codes, RTOS, filesystem among others.
Hope this helps.
Are you sure? yes | no
Hi @leonoydouglas.
It helps a lot! The terms I don't know I google and it's something new I learned about today ;). I gonna check this Crossworks IDE.It seems very helpful. Thanks for such a complete reply.
Are you sure? yes | no
I would get a Nucleo board. Its provides what you need to play with ARM and supports MBED and debugging with an off-line IDE like Embitz or Keil.
Are you sure? yes | no
Well, these nucleo boards seem pretty nice.
Thanks for the tip, @MobileWill.
Are you sure? yes | no
Np, its how I converted to ARM. There is also a DFU bootloader if you want to use the STM32 in your own project. http://www.mobilewill.us/2015/06/stm32-nucleo-and-dfu-usb-bootloading.html
Are you sure? yes | no
Hey, I just wanted to say you should really check out the Teensy 3.2 available from PJRC. It's an ARM Cortex M4 and they use the Arduino environment and have been very good about improving the libraries to suit their chip and supporting with additional hardware and appropriate libraries.
I've been using it and it has been relatively painless. I think they will even be releasing a version with more exposed pins soon.
It's ~$20 and you can even get it from the Hackaday store!
https://www.pjrc.com/teensy/teensy31.html
http://store.hackaday.com/products/teensy-3-2
Are you sure? yes | no
No SWD hardware debugging available as it is used by the bootloader chip. That's a deal breaker for me.
Are you sure? yes | no
Thanks for the reply, @Tim .
Teensy seems awesome, and I plan to get one. But for now I gonna try to learn about the guts of ARM microcontrollers, then I prefer to stick to just C. But thanks for the tip o/
Are you sure? yes | no
I have very little experience with ARM, but I have to say that ST does a pretty good job evangelizing their new chips and development boards. If you're lucky, they hold in-person seminars in various cities around the world where they give you a development board, toolchain, and spend about 4 hours helping you get started. That gets you over the hump, but what you say is very true. It's nice to have a large centralized community willing to share examples, libraries, projects, etc. when you're trying to go from beginner to intermediate. I didn't find a large amount of that with the STM32 stuff the last time I worked on them, which was about three years ago. I got about halfway through developing a "arduino-esque" library for rapid development, but as with many things, I got distracted and left it on the shelf.
Recently, I ditched my trusty AVR based boards for ESP8266 based boards mainly because most of what I do is networked and doing it on WiFi is so much easier for me. I do want a 32-bit version, for the same reasons you're looking to expand your knowledge outside of the 8-bit world.
Are you sure? yes | no
Thanks for the reply @krich
I got two Nodemcu boards here. Can I aks you what do you use to program them? I have only tried Arduino up to now. But some crashes when trying to connect to wifi.
Are you sure? yes | no
Well, I use the Arduino environment for rapid development, but it doesn't always give me the flexibility I need (for swapping out Espresif SDK versions, for example). When I need the flexibility or when the Aruduino IDE gets on my last nerve, I use the Espressif toolchain. It's pretty easy to set up on a Linux VM.
Are you sure? yes | no
@krich
Grand! I gonna check this tollchain. Thanks!
Are you sure? yes | no
@RobsonCouto You've asked all the relevant questions we are trying to solve. We have are making a ARM Cortex M3 development board with LPC1768. You can not just quickly prototype with Arduino but you can take it to the next level with Bare metal Programming, RTOS support and huge number of tutorials. We are making tutorials to answer all the questions from setting up tool chains like Eclipse, ARMGCC etc to deep dive into controller HW peripherals.
Here are specific answers to your quesiton:
1. Here is a tutorial on setting up Eclipse with ARMCC
http://exploreembedded.com/wiki/Setting_Up_ARM_GCC_And_Eclipse_For_ExploreM3_LPC1768
2. We had started our project with STM32F103 but we realized the MCU peripherals are not logically organized, the core support is not that impressive. We released that MCUs may be cheap but the development time is huge. Hence we would recommed LPC1768 from NXP.
3. We have been able to make great progress in heating up the bare metal. You may wish to check all the tutorials below all in one place. Right from tool chain setup to interfacing peripherals.
http://exploreembedded.com/wiki/Main_Page
The project is on hackaday.io, https://hackaday.io/project/10711-explore-m3, we are also running a beta testing program. If you're interested please do sign up and will ship a board a soon.
We have put immense effort to make small teams and individual developers get started with ARM. If you like it, please do share the project and help us spread the board.
Are you sure? yes | no
@Sandeep Patil Thanks for your answer.
Wow. Awesome project! I wish all the best!
For what I see, the LPC1768 uses the regular ARM instruction set, that's good.
I sure will have a calm look at your tutorials, thanks. I also signed up!
Are you sure? yes | no
Thanks!
Are you sure? yes | no
I have a tip for you:
Start with libopencm3
https://github.com/libopencm3/libopencm3
IRC Freenode: #libopencm3
Are you sure? yes | no
Thanks for the reply.
I am gonna check it out.
Are you sure? yes | no
I write my own code from scratch using the official hardware manual and I have played with a few different series of chips and vendors. To me, the they don't seem that different. So I select chip based on features and price to fit a project.
I like Freescale Kinetis ARM chips as they have much more advanced DMA controller, but ST has much better support as they churn out lots of eval boards for their chips. So pretty much means that it is far easier to get RTOS and other open source projects, libraries based on the STM32 chips than Kinetis.
I like RTOS, but right now I have to go bare metal for my project as I need far more control.
Are you sure? yes | no
Thanks for the reply @K.C. Lee.
But is difficult to compare processors when I have not tested any xD.
What environment do you use to program these Kinetis chips? Do they need a special programmer?
I am not familiarized with RTOS yet.`
Are you sure? yes | no
When I pick chips, I pick the ones with the cheapest price for the memory size, particular peripherals I think I need. Never much care for brand loyalty nor worry about having to rewrite low level source code.
I ported ChibiOS to unsupported target on my new untest board as my first ARM programming exercise. I have done some event programming and thread stuff on the PC and multitasking on Amiga, so RTOS seems natural to me.
Most of the ARM Cortex M chips uses SWD as the hardware debugger/programming interface and some support JTAG (4 pin)/SWD (2 pin). The Kinetis chips are marketed towards industrial users and the ones I used do not have boot loaders.
I use Keil MDK (demo) and programmer that support SWD. printf() do not work at all if your ARM core crashed. They crash a lot if you are a beginner and forgot to turn on clocks for your peripheral or don't initialize things correctly or access memory that isn't there. Initializing the PLL for Kinetis is a chore as you have to navigate a state machine. MDK helps a lot as in the debugger, the peripheral registers are annotated.
Are you sure? yes | no
Thanks again for the reply @K.C. Lee
A very complete answer. A lot of terms I don't know, but this only means I have things to study.
I can't buy a programmer now, so I have to stick to what I have now or use chips with bootloaders. But I will get one of these Kinetis micros when possible.
I gonna serach about SWD right away xD.
Are you sure? yes | no