0
\$\begingroup\$

I have looked through the data sheet for, ATSAM4LC2BA-AU but found nothing regarding what language it uses, I was hoping to code C onto it, also any thing on the necessity of a boot loader?

\$\endgroup\$
3
  • \$\begingroup\$ Look at the data sheets for the manufacturer's development tools. That's an ARM device, a pound to a penny says it will have at least C tools, and a loader for the flash in the dev kit. \$\endgroup\$
    – Neil_UK
    Mar 4 '16 at 20:38
  • 1
    \$\begingroup\$ The GNU C tools are available for virtually any ARM-based processor. And many dev boards are also supported by OpenOCD for flashing and debugging. \$\endgroup\$
    – Eugene Sh.
    Mar 4 '16 at 20:51
  • \$\begingroup\$ If you have to ask this then you're really going to struggle. 32bit chips are no joke if you're programming from scratch. I would suggest using something easier. 8-bit atmel chips are easy, 8/16 are a littttle more involved. \$\endgroup\$
    – Cameron
    Mar 5 '16 at 6:03
3
\$\begingroup\$

The chip you mention uses an ARM Cortex M4 processor, so any compiler that targets that core can be used. For example, GCC has front ends for C and many other languages, and a back end that supports the M4. The compiler 'front end' eats high level language code, and the 'back end' squirts out object code which is linked to create a program in binary that can be programmed into the microcontroller's flash memory. That particular one has up to 512k bytes of flash. There are other compilers such as Keil that come with lots of support (and a commensurate price tag if you need more than some limited amount of capability).

A bootloader is a program used to load other programs. MCUs typically have at least one way of loading object code that does not use a bootloader, since the bootloader itself has to be loaded somehow to begin with. A few may have a bootloader in ROM.

This particular series, like many higher end micros, has a JTAG port. You would typically use a JTAG interface adapter connected between your computer and the system for both writing to the flash memory and for debugging. It's usually a good idea to dedicate those particular pins to the JTAG port and not try to share them with any other functions.

enter image description here

Evaluation boards may have another MCU on the board that performs a similar function.

\$\endgroup\$
0
5
\$\begingroup\$

Microcontrollers don't "use" a language. They execute machine instructions that are stored in binary in their program memory.

If you want to code in C, then you have to use a program that converts the C you write into the machine instructions the micro will execute. This is called a compiler. You probably also need a linker to go with that, although compilers and linkers usually come bundled together.

However, you need to learn how computing machines really work first. On a big machine with a operating system, it's useful to understand what a compiler, librarian, and linker do, and what the machine itself ultimately does. On a small machine like a microcontroller, it's essential. Without this understanding you're not going to accomplish anything with a micro.

\$\endgroup\$
3
\$\begingroup\$

In general, a given processor does not "use" any particular high-level language. Instead, it will have a particular instruction set which is most simply modelled in assembly language. Higher level languages, such as C, require a compiler which is tailored to the specific target chip.

And generally MCU programs are stored in ROM rather than externally on tape or something else, so no boot loader is required.

\$\endgroup\$
6
  • \$\begingroup\$ With microcontrollers, a boot loader is often used to initially load the program into the internal ROM, but is then not used in normal operation. \$\endgroup\$ Mar 4 '16 at 20:33
  • 1
    \$\begingroup\$ ... unless it's flash program based, in which case the dev sdk will often come with a loader. Perhaps a better question from the OP would have been 'what HLLs and tools does the sdk for this MCU use? \$\endgroup\$
    – Neil_UK
    Mar 4 '16 at 20:34
  • \$\begingroup\$ @Neil_UK - Good point. \$\endgroup\$ Mar 4 '16 at 20:41
  • \$\begingroup\$ Atmel Provides an HDK of sorts, consisting of board and cpu definition headers, linker scripts and startup code, with a minimal c api for peripherals. There is even a sample bootloader implementation - @OzzieSpin should peruse all the documents and attachments provided by atmel related to the sam4 link \$\endgroup\$
    – crasic
    Mar 4 '16 at 20:41
  • \$\begingroup\$ I will try that, where do you think I would be able to find information regarding whats pins can be used for uploading the code. Thank you. I have tried the data sheet but no avail. \$\endgroup\$
    – OzzieSpin
    Mar 4 '16 at 20:46
0
\$\begingroup\$

To add to Olin's answer. You dont normally use or at least need a bootloader for an mcu like this. The mcu logic usually provides ways to reprogram the flash so you dont need a bootloader to allow the developer to interrupt the normal boot and reprogram the flash. Some mcus, perhaps this one in addition to logic based solutions may also include a factory installed bootloader that allows for other interfaces (uart or usb or spi, etc) to be used to reprogram the flash.

If you have not mastered the toolchain (compiler, assembler, linker) though or at least have found a sandbox that has done this for you, then you are not ready to load binaries on the flash anyway, bootloader, or jtag or other.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.