Hex file transfer back from pcb - c

I'm working on a small project using an NXP lpc1769 demo board. I'm using LPCExpresso 5 from CodeRed to program it and I would like to know if I can transfer the application hex/bin file back from the board to the PC.
Either with the IDE or with any other solution.
Thanks in advance!

If you have access to ISP pin and UART0 lines, you can use FlashMagic to display memory one sector at the time.

Related

niosii processor Altera C program

I'm currently working on the Altera DE0 board with the QuartusII Web Edition software. I need to use a nios processor on Qsys to display a shifted signal from a GPIO pin on my board. The input signal would be a clock signal from an external source. The problem is that I have no idea how I can write a program in C (on the Eclipse IDE) for diplaying a delayed clock on an oscilloscope.
My Qsys design looks like that Image1 => Qsys Design and here the Eclipse IDE where I have to write my C program Image2 => Eclipse IDE
Please help me !
thank you very much in advance for the replies
start with the system.h file to know which base_address is assigned to each peripherial, then you can use pointers to directly access the GPIO or use the IORD/IOWR functions.

STM32 F407VG Boot into different (main-)applications

For a project I just started working on, I need to write a firmware in C that lets me boot into two different firmware versions. The task is to be able to update a device which includes an STM in the field using the RS485 Port with an Intel .hex file. My idea was to place the two firmware versions at designated starting addresses in the flash, including some kind of checksum for data integrity. According to the flash module organization found in the reference manual, my first thought was to place one version into sector 10 (starting at 0x080C0000) and the other version into sector 11 (starting at 0x080E0000). After every reset, the STM32 should boot into a "bootmanager" which is just minimum code that decides, whether the firmware in sector 10 or sector 11 is the newer version. I want to clarify my idea in the following graphic:
[Rough process][1]
[1]: https://i.stack.imgur.com/xLowh.png
The 128kBytes of every sector are sufficient. So far, I was able to write Single Bytes into the Flash and read them afterwards. Also, I have already set up a working UART communication using the RS485.
My questions
Can I just write the .hex file into the Flash as it is without modification like
:020000040800F2
:1000000002200B
etc?
As I am unexperienced with with jumps: How should I perform the jump from the "bootmanager" into sector 5 firmware? Are the adresses automatically relative to the entry point in sector 5?
Can you give me keywords or tell me, what challenges I will encounter?
*EDIT: I'm aware that the STM itself contains a bootloader. Unluckily, the RS485 device is hardwired to the GPIO pins used by USART2. According to the reference manual, the internal bootloader can only be used by USART1 and USART3, CAN2 and USB OTG FS
Can I just write the .hex file into the Flash as it is without
modification like
no you cant. You need to modify the linker script to archive it
You need to have the whole both applications in the FLASH so divide it 50/50%.
I usually add some serial FLASH to have a copy of the firmware if both of the images are damaged.
Yuo need to write the custom bootloader.
Most of the STM32 microcontrollers have support for dual memory bank and on the fly update (cf AN4767 - On-the-fly firmware update for dual bank STM32 microcontrollers)
This will allow to perform exactly what you require.
Usually the microcontroller will need to have a bootloader and 2 banks for the image.
When booting the bootloader will start and check which version it would have to boot and set the start address accordinngly.
This application note is for the F7 series but you can check it to see how it could work for your specific microcontroller (cf AN4826 - STM32F7 Series Flash memory dual bank mode).
Regarding your questions:
The code would be written as usual but twice (or 2 different firmwares)
Look into the application notes referenced and keywords such as: dual bank, on-the-fly update, DFU, etc

Using I2C on XMC1100 2Go

I recently got the Infineon 3D Magnetic Sensor 2Go development board (based on the XMC1100 microcontroller) and I would like to know how to read input from the 3D Magnetic Sensor which is interfaced through I2C. I am new to the Infineon development system, so I do not know how to gather and process input from the sensor.
Here is what I know so far:
The main microcontroller is an Infineon XMC1100-Q024F0064
The 3D Magnetic Sensor is connected to the XMC1100 via I2C
How to program and control the GPIO on the XMC1100
How to use the supplied stand-alone applet to view data from the Sensor
I have the DAVE IDE, the APPs extension, and I am writing my code in C. I need to use DAVE to accomplish my desired end result, but I would be interested to know the Arduino method as well.
Thank you in advance for your help!

USB driver for STM32l100rc using HAL library

Is there anyone who has worked on STM32L1 series. I'm working on STM32L1xx series and wanted to write USB driver for it. Is there any example for USB driver for STM32L series or anyone worked on STM32L1xx series? Any help will be appreciated.
Thanks in advance.
You need these works to do:
1.USB client driver on STM32. There are lots of available codes in github or other website;
2.SDcard driver. Normally SDCard has two modes, include SPI mode and SD mode, the operation will be simplified a lot in SPI mode, however, in SD mode the speed will more faster than SPI mode. you can refer to datasheet for more information.
Download STM32CubeMX
Download STM32CubeL1
Start new project for your device, choose peripheral, choose device class for MSC
Setup clock for USB
Export project
Configure SPI for your SDCARD (SDIO is not available) for interface between USB device stack and SDCARD sector read on PC demand.
This are key steps to do, as I don't know what you know so far (looks like nothing) and what you have learn yourself so far (looks like nothing) I'm unable to give you comprehensive answer.

Communication with mbed using C

How can I communicate with an mbed LPC1768 using C without using a terminal emulator like minicom or teraterm?
For example if I send an integer from my C code than that led should be turned on.
How can I do this?
Without reading user manual or datasheet you can't do any thing to your board. So just go through it then follow below link for demo application LPC1768 board
1.NXP LPC1768 ARM Cortex-M3 Red Suite Demo
2.LPC1768 ARM Cortex-M3 CrossWorks Demo
3.mbed
4.At github
If you are using linux or osx check out the following answer:
How do I read data from serial port in Linux using C?
You can check your /dev folder and look for a file that is created when you plug your mBed. The file name would be something like /dev/ttyS0. That file represents the communication port, you can read/write that file to receive/send data over serial port.
If you want a cross platform solution try RxTx library for Java.
You can use this library
what it does, is that it initialize UART port which is connected to the debugger on your board and use it as serial input output. so with any hyper terminal of your choice, you can write code to do something if you send certain string of characters or just use original printf when something happens. and it will be printed on your PC screen.

Resources