Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What program should I use to program an ARM processors

Status
Not open for further replies.
What exactly do you mean when you say "program" a microcontroller? Do you mean writing and compiling code? Or uploading the code?
 
What exactly do you mean when you say "program" a microcontroller? Do you mean writing and compiling code? Or uploading the code?

I mean, write/have a code to run a motor/turn an LED on/display some characters on a LCD display etc. This is what I mean when I say program a micro controller.
 
I mean, write/have a code to run a motor/turn an LED on/display some characters on a LCD display etc. This is what I mean when I say program a micro controller.
That did not answer my question. You just described what you want the processor to do, which is not what I asked for.

What if I put it this way:

ANY external hardware programmer can upload machine code into a processor as long as you use the programmer's standalone software.

An IDE and the compiler and linker inside it in it is used to write code and compile it into machine code.

If the IDE is properly set up for the programmer, you can upload machine code to the processor without leaving the IDE and without needing to use the programmer's standalone software.

The Segger IDE, specifically, seems to use the J-Link as a license dongle so you need it it plugged into to compile machine code.

"Uploading" and "flashing" mean the same thing.

Debugging requires a programmer(also called a debugger in this case) that has debugging capability. Debugging also requires the IDE to be set up properly for debugging with the specific programmer. This lets you observe memory inside the processor as the code is executing so you need the IDE.
 
Last edited:
That did not answer my question. You just described what you want the processor to do, which is not what I asked for.

What if I put it this way:

ANY external hardware programmer can upload machine code from anywhere, written in anything, as long as it is already compiled as long as yo use the programmer's standalone software.

An IDE and the compiler and linker inside it in it is used to write code and compile it into machine code.

If the IDE is properly set up for the programmer, you can upload code directly inside the IDE without needing to use the programmer's standalone software.

The Segger IDE, specifically, seems to use the J-Link as a license dongle so you need it it plugged into to compile code.

"Uploading" and "flashing" mean the same thing.

Debugging requires a programmer(also called a debugger in this case) that has debugging capability. Debugging also requires the IDE to be set up properly for debugging with the specific programmer. This lets you observe memory inside the processor as the code is executing so you need the IDE.

ok, my thinking/assumption for every Microcontroller hardware programming is like using the Arduino Boards with Arduino IDE.
 
ok, my thinking/assumption for every Microcontroller hardware programming is like using the Arduino Boards with Arduino IDE.
You plug the computer straight into the Arduino right? There is no "box in between the PC and the Arduino? That "box" is the external programming hardware (also called the programmer or the debugger).

If you can plug the computer straight into the Arduino, it either means that the Arduino has the circuitry for the programming hardware on the board already, or there is a bootloader inside the processor so the it can interpret the signals from the desktop computer and program itself.

The Arduino IDE is obviously made to work with the stuff in the above paragraph. So the Arduino IDE makes it seamless to write, compile, and upload code (there is also technically a linker step after you compile). In general, these are three different stages. Even writing code and compiling code might be separate stages (some people write their code in a text editor, use a command-line compiler to generate the machine code, and upload the code with a programmer and its standalone software).

The best and most convenient possible setup is where you can stay in the IDE for everything like you can in the Arduino IDE programming an Arduino board, or using the Segger IDE with the Segger J-Link. But if you are trying to use Arduino code with something other than an Arduino board, this is no longer the case so the different steps start becoming broken out.
 
So to write code, one application is used, to compile it another one, to execute it/upload the code another one correct?
 
You plug the computer straight into the Arduino right? There is no "box in between the PC and the Arduino? That "box" is the external programming hardware (also called the programmer or the debugger).

If you can plug the computer straight into the Arduino, it either means that the Arduino has the circuitry for the programming hardware on the board already, or there is a bootloader inside the processor so the it can interpret the signals from the desktop computer and program itself.

The Arduino IDE is obviously made to work with the stuff in the above paragraph. So the Arduino IDE makes it seamless to write, compile, and upload code (there is also technically a linker step after you compile). In general, these are three different stages. Even writing code and compiling code might be separate stages (some people write their code in a text editor, use a command-line compiler to generate the machine code, and upload the code with a programmer and its standalone software).

The best and most convenient possible setup is where you can stay in the IDE for everything like you can in the Arduino IDE programming an Arduino board, or using the Segger IDE with the Segger J-Link. But if you are trying to use Arduino code with something other than an Arduino board, this is no longer the case so the different steps start becoming broken out.

So when using the Segger IDE, what is the "box", the "writing code application", the "compiling code application" and "uploading code app"?
 
So to write code, one application is used, to compile it another one, to execute it/upload the code another one correct?
Yes. It was always like that but things have gotten more integrated and convenient. But if you do something out or the ordinary those things becomes separated again.


So when using the Segger IDE, what is the "box", the "writing code application", the "compiling code application" and "uploading code app"?

The box would be something like the J-Link or the ST-Link V2. It's some piece of electronics that sits in between the processor and the desktop computer (though it might also be built onto the board in some cases).

IDE stands for Integrated Development Environment so it combines the writing and compiling code parts. It might also combine the uploading code part if it supports the "box" and is properly set up for it.
 
Yes. It was always like that but things have gotten more integrated and convenient. But if you do something out or the ordinary those things becomes separated again.
so the people at Arduino have made life simpler by putting all these three into one app and given us to download it on their webpage correct?
 
so the people at Arduino have made life simpler by putting all these three into one app and given us to download it on their webpage correct?

Yes. Which means if you wanted to do something different than what it was made for (like uploading ARduino code onto a non-Arduino board) then you have to step inside the chain and break part of it off.
 
Yes. It was always like that but things have gotten more integrated and convenient. But if you do something out or the ordinary those things becomes separated again.




The box would be something like the J-Link or the ST-Link V2. It's some piece of electronics that sits in between the processor and the desktop computer (though it might also be built onto the board in some cases).

IDE stands for Integrated Development Environment so it combines the writing and compiling code parts. It might also combine the uploading code part if it supports the "box" and is properly set up for it.

So segger IDE has the writing and compiling code parts, and I need to setup the "box" for it to upload the code for which I can use the J link EDU mini to act as the "box" to upload code and it doesn't work with the STM link v2 because in segger IDE, ST link V2 is not supported. am I right?
 
So segger IDE has the writing and compiling code parts, and I need to setup the "box" for it to upload the code, which segger IDE does with the J link EDU mini and not with the ST link V2.
Yes, the Segger obviously wants you to use both their J-Link and their IDE so they have already set up the Segger IDE to work with the J-Link. It will not work out-of-the-box with the ST-Link (though you can configure the IDE to work with the ST-Link if you know what you are doing).

That means that if you want to use the Segger IDE to write and compile code but upload code with the ST-Link, you either have to configure the Segger IDE to work with the ST Link, or you have to compile the code in the Segger IDE into a file type that the ST-Link can upload (i.e. s-record, hex, binary, ELF etc.) and then go use the ST Link standalone software to upload the code.

The problem with that is that the Segger IDE won't compile code without a J-Link connected (not unless you buy a standalone software license). I think it has something like a trial period but that time limits disappears while you have a J-Link connected.
 
Yes, the Segger obviously wants you to use both their J-Link and their IDE so they have already set up the Segger IDE to work with the J-Link. It will not work out-of-the-box with the ST-Link (though you can configure the IDE to work with the ST-Link if you know what you are doing).

That means that if you want to use the Segger IDE to write and compile code but upload code with the ST-Link, you either have to configure the Segger IDE to work with the ST Link, or you have to compile the code in the Segger IDE into a file type that the ST-Link can upload (i.e. s-record, hex, binary, ELF etc.) and then go use the ST Link standalone software to upload the code.

The problem with that is that the Segger IDE won't compile code without a J-Link connected (not unless you buy a standalone software license). I think it has something like a trial period but that time limits disappears while you have a J-Link connected.

Finally clear with this. I dont know how to thank you, you have solved a big worry of mine. Thank you so much for all this. Sorry for the trouble I created by making this really lengthy, I am in 12th grade, dont know much of this stuff. Thanks a lot for your patience and dealing with me!
 
I remember when I was sitting there wondering how on Earth I get a desktop PC to connect to a bare chip. It didn't seem like the chip could do it on its own natively.
 
I remember when I was sitting there wondering how on Earth I get a desktop PC to connect to a bare chip. It didn't seem like the chip could do it on its own natively.

xD Same here, Arduino spoilt me with its easy to use IDE. I realised life is not easy now.
 
xD Same here, Arduino spoilt me with its easy to use IDE. I realised life is not easy now.
Expect to spend a lot of time reading line by line through the registers on datasheets when you start working with a new processor or peripheral. Once you have things set up though it's not so bad but it's a PITA to set up anything new so code cleanly and legibly the first time around so you can re-use it. The actual separation of uploading software and IDE is not so bad though.
 
so the people at Arduino have made life simpler by putting all these three into one app and given us to download it on their webpage correct?

'Sort of', in reality it's like most other IDE's, it still has the separate editor, compiler, linker, and programmer - the IDE just integrates them in one seamless package - which is what all IDE's do really, hence the 'I' for Integrated.

The difference in the Arduino is that you don't need a hardware programmer, the boards come pre-programmed with a bootloader which allows you to program the chip with a simple serial connection. Again, the IDE makes it easy and transparent (usually - but less so for the STM32) - but depending on the chip/board you may have to short pins together, or hold a button down, in order to enter bootloader mode.

Bootloaders are nothing new, they have been round for decades, you could program bootloaders in PIC's many, many years ago (but you needed a programmer to do that part), once the bootloader was in the chip you could then program it without a programmer.

The reason it's not universal is simply waste, the bootloader itself takes space, which isn't available for the final application to use (unless you write over the bootloader, which means you can't use it again). When the Arduino was designed it was decided to use a fairly large chip capacity chip, so the wasted space is a relatively small percentage of the available space in the device.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top