How do I program my atmel develper board with sample program on the usb - atmel

I have successfully compiled a sample program, which came with a developer board. I have also connected to the board via putty and ran the executable which was on the board from the factory. But I can not push my elf file to the board apparently because the debug/programming interface is missing. I can not figure out what the issue is. I turned off Win7's firewall, and defender before I installed the driver. Enclosed are a couple of pics; do I need to purchase a JTAG to usb cable? Right now, I am just connected to the board via the usb interface which is on the board. But the board comes with JATG, and miniJTAG.
#DigiNinja- I have AT97SC3205T-SDK2. Can you also comment on the firewall? Do I need to keep win firewall and defender off all along or just while I install the USB driver?
I posted a pic of the board with all the other interfaces.
Do I need one of these
Here is a pic of Device Programming options:
#all- Thanks. I have a starting point. I need to read the docs now.

The user guide provides the info you need, and can be downloaded here: http://www.atmel.com/Images/Atmel-8528-TPM-I2C-SPI-Development-Kit-UserGuide.pdf
From the user guide:
"The USB bootloader remains pre-programmed in ROM memory. This bootloader may be used to either reload the TPM demonstration software images or to load the SAM4S ARM demonstration software. The kit has a JTAG connector that can be detached from the kit and connected to the mini JTAG connector on the board. This will allow the reprogramming of the SAM4S ARM."
So that means you should be able to load new software images using the pre-loaded USB bootloader. If you don't want to use the bootloader or it's been removed then you will need to use JTAG.
From the user guide: "For more advanced in-system programming techniques, the In-System Programmer SAM JTAG ICE combined with Atmel Studio® can be utilized over the provided JTAG interface port to exercise complete programming control over the processor."

Related

Platformio which ESP32 board to pick

Hello and happy holiday to all
I am using platformio for an arduino project for the first time. I have purchased this ESP32 borad:
EC Buying ESP32-DevKitC Development Board ,ESP32 Development Board Equipped with WROOM-32D Module Integrated WiFi Bluetooth Module Microprocessor Interface SPI I2C I2S Suitable for Arduino
I am new to all this and need to know what board I should pick in PLATFORMIO for this board. I have loaded the core 32 from Espressif 32 and have the large list of ESP32 boards.
just want to make sure to pick the correct board to match the one purchased. Here is also the link to amazon on the board purchased.
https://www.amazon.com/dp/B0B64SD16T?psc=1&ref=ppx_yo2ov_dt_b_product_details
Thanks to all you wonderful people who can help.
I have not tried any boards listed as I did not what to damage this new board.
You won't damage an ESP32 by choosing the wrong PlatformIO board. The worst that will happen is that you won't be able to flash your program to the board, or it won't run correctly when it's flashed. While it's not impossible to brick an ESP32 by configuring security options, that's not something PlatformIO is going accidentally do to your board.
You can search the list of available boards on the web and look for a close match.
The most important thing is to get the correct processor type - figure out whether you have ESP32, ESP32-S2, ESP32-S3, ESP32-C3 (or eventually some other kind of ESP32). Only consider PlatformIO boards for that specific CPU. Then look for the size of the flash storage. Usually any board that matches that spec will work.
esptool.py, the program PlatformIO uses to flash the firmware to the board, will detect the CPU type, so if you have an ESP32-S2 and try to flash code for an ESP32 to it, it will detect this and report an error.
In your case you might try the generic Espressif ESP32 Dev Module:
[env:esp32dev]
platform = espressif32
board = esp32dev
If your first try doesn't work, it's safe to try another.

Using JTAG interface for programming

I am developing a system for which I need to program MCUs like PSoC or Atmel SAM4E or Freescale K70 Series. Currently, I am using vendor specific IDEs and Peripherals like 'Miniprog from cypress' to program them, but I want to have a generic programming tool which uses JTAG Interface and don't need any extra peripheral like MiniProg, But I am new to this and really have little idea about how to go ahead with this. So any suggestion is welcome about how to get started with setting up a JTAG programming interface.
In the above example, the SAM4E Xplained Pro Evaluation Kit does not have a JTAG port so it cannot be used with the SAM-ICE JTAG emulator.
With JTAG you can have full control of MCU, e.g. to flash and debug it, run program, stop it when you wish or set watchpoint, breakpoints, triggers for memory values and so on. Most modern MCUs have JTAG interface. That means the JTAG module is inbuilt in the crystal's system. It also means that a MCU has a physical JTAG lines, electric contacts, pins of its package. On evaluation boards, also known as starter kits, these JTAG pins combined into a separate connector. In this connector should be plugged in a JTAG adapter with, usually, USB bus on the other end, turned into your computer.
It is widely used to put a JTAG connector to the board design in order to have a debug capability for the product in all life stages.
For example, Atmel offers an evaluation board SAM4E Xplained Pro Evaluation Kit for Atmel SAM4E:
and the JTAG emulator for it:
For other MCUs you should always check for the compatibility between JTAG emulator and cores supported.

Virtual com communications with no usb2uart bridge?

I'd like to connect a beagleboard-like (custom developed) omap board to a Windows PC using a virtual-com setup. That is, i'd like the board to appear to Windows as a com device and get the COM to send data to our application on the board. The main reason for that is to use virtual-com drivers on windows, since the usb drivers we use now to directly sent data over usb between the host and the board seem not to work properly.
I have done this using the FTDI driver on the past but as far as i know it worked because the device had an FTDI chip that translated the usb protocol to serial signals (am i right ?).If there's no USB to UART bridge on the board, how could i do that ?
By the way, how USB Communication Device Classes fits here ? Should develop a CDC driver for the board ? What should I use then on Windows side ?
I'm kind of confused, so any help will be greatly appreciated :)
Well, i answer myself :)
The solution lies in the Linux USB Gadget Subsystem.
Gadget API

BLED 112 - update BGScript based firmware with SDK v1.1.1

I purchased a BLED 112 dongle from BlueGiga (http://www.bluegiga.com/BLED112_Bluetooth_smart_dongle). I purchased the dongle since I was trying to do a simple POC with an iPhone. I did not want to get into breakout boards or the dev kit just yet.
I am trying to get the heart rate monitor samples working and I am not sure how to load the firmware on the device. I am using the latest version of the SDK (v1.1.1) which states to use the BLE Update tool, not the TI Flash Tool.
However it looks like you need the CC Debugger with the BLE Update Tool to update the SOC. I looked at the CC Debugger and it does not appear to be designed to be used with BLED 112 USB dongle. It appears you need a breakout board to expose the pins to be able to hook the CC Debugger to a BLE 112 module, not a BLED 112.
Lastly, I am not sure if DFU will work without bricking the dongle.
Any advice on how to properly use and program the BLED 112?
Thanks,
G
From the SDK docs:
TI Flash tool should NOT be used with the Bluegiga Bluetooth Smart SDK
v.1.1 or newer, but BLE Update tool should be used instead. The BLE112
and BLE113 and BLED112 devices contain a security key, which is needed
for the firmware to operate and if the device is programmed with TI
flash tool, this security key will be erased.
It is possible to update the firmware on the BLED112 via the USB connection, and without requiring a breakout box or a CC Debugger. However, it is fairly easy to accidentally 'brick' your device in so doing. The problem is that the firmware itself needs to provide the interface to enable DFU mode; if you do an update with your own firmware, and your firmware doesn't provide this capability, you're stuck with the last thing loaded on it.
That being said, here's the process.
The BLED112 dongle is essentially just a BLE112 with an attached USB connection. The BlueGiga SDK ships with drivers that allow the device to be mapped with a simple serial interface, such that the device shows up as a simple COM port (e.g., "COM16") to applications running on the host PC. The SDK also ships with two utilities - BLEGUI, and DFUTOOL - that are able to use this COM port interface to communicate with the device.
(Getting the drivers installed seems like it should be easy, but the process was finicky for me, and I ended up having to mess around with Device Manager, etc., for a while before getting the COM port to show up reliably when I attached the dongle.)
The basic process for building and installing firmware on the BLED112 is:
Compile your BGScript program to an image file using BGBUILD.EXE
Reboot the dongle into firmware update (DFU) mode using BLEGUI2.EXE
After attaching to the appropriate COM port, select Commands | DFU from the menu.
Update the firmware using DFUTOOL.EXE
Before you do this, make sure you read the "Developing Bluetooth 4.0 single-mode applications" and other technotes from BlueGiga's forum (registration required). Specifically around your project configuration:
WARNING:
If the firmware is to be installed into the BLED112 USB dongle the USB
CDC configuration MUST BE included in the project file. If this is not
included in the project file and the compiled firmware is installed
into the BLED112 USB dongle, the USB interface will be disabled and
the dongle stops from working.
Phew. Not necessarily for the feint of heart. I personally found it more appealing to shell out the money for the DKBLE112, which has the BLE112 module mounted on a board with some other accessories, and a CC Debugger for programming. With this setup, you can flash new images to the chip without worrying so much about screwing things up (there's a "reset" button on the board itself).
Other people have reported using breakout boards that are cheaper than the DKBLE112, such as this one from Jeff Rowberg. They also let you program with the CC Debugger, but I have no experience with them.
Have fun!
Based on the information provided, I found the following technote on the BlueGiga support knowledge base.
https://bluegiga.zendesk.com/entries/22810076--HOW-TO-Run-a-BGScript-application-on-the-BLED112-USB-dongle
Thanks
Greg

Upload Arduino code on virtual serial port through Arduino IDE

I downloaded several software that provide virtual COM ports. These COM ports do appear in the Device Manager and can be selected for upload from the Arduino IDE, menu Tools -> Serial Port -> COM3. It starts uploading and reaches 90% and then it either times out or just does nothing.
I want to upload onto the virtual COM port so I could then read the compilation output files in another program. I don't want to use my Arduino at all, and I don't want to manually get the verbose output files when uploading. This problem doesn't happen when I upload on the real Arduino.
The application should work on all platforms. This task seems easy on Linux, and I am facing the stated problem on Windows and any help with Mac would also be useful.
The application will be an educational tool for hardware simulation and visualization trying to give a more hands-on experience for users than other simulators out there. So may be this will give you an idea of why I want to do so.
How can I get started?
I think you might be assuming that uploading code to Arduino is one-way communications: this would be like putting strawberries in a blender, and a Daquiri comes out. If that was true, you could just take whatever the IDE dumps to the serial port, save it to a file, and you have an Arduino binary. (Skip to TL;DR if not interested in details. Upshot: this assumption is not correct).
The 1-way communication assumption is not entirely correct: there is a program on the Arduino (called "a bootloader") which is responsible for communicating with the programmer ("programmer": a program that programs the Arduino, assume it is the Arduino IDE for now). In their most "natural" state, the Arduino CPUs cannot be programmed across serial lines. Rather these chips are programmed either via the in system programming (ISP) or via the JTAG protocol. The bootloader is a program that runs on an Arduino CPU and loading of sketches/programs over the serial port. This program runs at startup and looks for programming commands over the serial port.
If it discovers that a programmer is trying to communicate programming information, it will read the compiled Arduino binary coming over the serial link, store it in flash memory, send it back to over the serial link for verification, and if everything is successful, exit and launch the stored sketch. If no programming information appears on the serial port, that is, no programmer is trying to write a new sketch, then the bootloader simply quits and launches the program already stored in flash.
TL;DR: In order to implement a pseudo-Arduino on your serial port you must write a program some code that simulates an Arduino (bootloader) on the other end of your virtual serial port. So when a programmer/IDE says to Arduino "are you there?" your program will respond "yes!", just like an Arduino would.
The default Arduino bootloader is STK-500 compatible: that means that it implements STK-500 commands - the reference for which can be found here. If you decide to do this, then the easiest thing might be to start with an existing bootloader, such as Arduino's or AdaFruit's (there are others too), and modify it. Such a bootloader would have all the commands already implemented, and since it is written in C (I wouldn't choose an assembly bootloader to modify :), it should be easy enough to modify.
Alternatively, you might decide that STK-500 is too difficult to implement. If this is the case, you can use any programmer protocol that Avrdude supports: Avrdude is a program for programming AVR chips, and Arduino IDE uses Avrdude internally to send the sketch to the Arduino. If you do this, then you'd have to change the settings in Arduino IDE for which programmer you are using.
Personally, I think STK-500 compatible is the best option for this, but YMMV.

Resources