I read somewhere that you can use arduinos to program other microcontrollers. Is it possible to program a Cortex M4 that way? Can someone point me towards the code I'd need to do that?
Can you explain why you would want to do that ?
One thought : Cortex M3 + DSP = Cortex M4
ard_newbie:
Can you explain why you would want to do that ?One thought : Cortex M3 + DSP = Cortex M4
I'm using a Cortex M4F in a project and I want to be able to program it without a ridiculously expensive programmer.
There is a group of guys who have put together Arduino support for STM32 microcontrollers including (limited) support for the STM32F4 Cortex M4 series. These chips have a built in firmware upload capability so the only special programming hardware required is a USB to Serial converter.
http://wiki.stm32duino.com/index.php?title=Main_Page
http://www.stm32duino.com/
Outside of the Arduino ecosystem STM32 device programmers (STlink V2) are pretty inexpensive and there is reasonably good open source software that includes development and in circuit debugging tools.
MrMark:
There is a group of guys who have put together Arduino support for STM32 microcontrollers including (limited) support for the STM32F4 Cortex M4 series. These chips have a built in firmware upload capability so the only special programming hardware required is a USB to Serial converter.http://wiki.stm32duino.com/index.php?title=Main_Page
http://www.stm32duino.com/Outside of the Arduino ecosystem STM32 device programmers (STlink V2) are pretty inexpensive and there is reasonably good open source software that includes development and in circuit debugging tools.
Would that programmer work on Cortex M4 micros that aren't from ST? For example: this?
EDIT: I'll just get an ST Cortex M4
Would that programmer work on Cortex M4 micros that aren't from ST?
Not sure, but since it cost 10$, you don't take a big risk : Newbiehack-Development Tools-Prototyping-Microcontroller-USB-ARM-Programmer-Stlinkv2-Stm32-Stm8
An interesting video if you use a bare bone solution :
Nymx:
Would that programmer work on Cortex M4 micros that aren't from ST? For example: this?EDIT: I'll just get an ST Cortex M4
I'm pretty sure STlink is proprietary to ST and won't work with other vendor's chips.
There may (or may not) be other vendors with serial device firmware uploader capability, but, to my knowledge, nothing that has been integrated with the Arduino tools.
TI products are in general a bit more expensive.
Suggest getting a TI eval board with built-in programmer and use it. Have a look here: http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/c2000_performance/control_automation/tm4c12x/tools_software.page#ekits
Is it possible to program a Cortex M4 that way?
Theoretically. Cortex-M4 has standardized debugging access (JTAG/SWD) and a standard USB access (CMSIS/DAP), and there is an "existence proof" in the Atmel SAMD10 Xplained Mini (which has an ATmega32u4 as it's mEDBG interface, and talks to an ARM (CM0+))
However, the interface for programming flash memory is NOT standardized (typically handed by a manufactuter-dependent "flash memory controller" peripheral of the chip, so it's not quite as simple as you might think. And I don't know of anyone who has put all the pieces together and written an Arduino sketch. The closest thing i know of is probably GitHub - ataradov/free-dap: Free and open implementation of the CMSIS-DAP debugger firmware
Now, that's for debugging/programming via JTAG. You should also consider that many CM4 chips (including the MSP432) include a built-in serial or USB bootloader, and don't NEED a separate programmer. It may or may not be useful to have an arduino program in between a PC and the built-in bootloaders. http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=SLAU622&fileType=pdf
without a ridiculously expensive programmer.
For the MSP432, there is the "ridiculously cheap" MSP432 Launchpad, which includes a debugger/programmer interface that I think can be used to program off-board chips as well... A lot of CM4 vendors have similarly inexpensive development boards...
If your requirement is only to program the M4, then the programmes are relatively inexpensive. The ST Link v2 is bundled on the STM Discovery boards, which are just a couple of tens of dollars.
In my limited experience, the programming/debugging device is only half the problem :(.
Depending on which SoC you have chosen with the M4 , (STM, TI, Atmel etc), the environment to develop and compile the code is equally important. Most of the programmers from the SoC manufacturers have flash programming drivers that are coupled to the manufacturers' own flash devices. So, although I haven't tried it myself, I suspect that a programmer from one of the STM would probably not support TI and Atmel SoCs, and vice versa.
So go for a programmer from makers like Segger. But that is expensive, too.
The easy to use toolchains are very expensive - the IAR Embedded Workbench comes in at approximately USD3000+ for a non updateable single seat license !! Keil MDK ARM is equally high on cost for individual developers.
STM has given the Atollic TrueStudio for free to promote the use of their SoC's by independent developers. However, I am not aware if TI's toolchain is free... Atmel Studio also has a free ARM gcc toolchain, too. Silicon Labs too have ARM CM4 SoCs and they give a free development environment but you need to have your own compiler toolchain installed. ( Experts may please correct me if I am wrong)
.
Try this site http://www.stm32duino.com/index.php[\url]