Suggest Possible ROM chips and RAM chip that can be interfaced to STM32F407 for TouchGFX - framebuffer

I have STM32F407 Boards like STM32F407 Disco board (without TFT) and some basic Chinese Boards. I have interfaced my TFT LCD with the board using FSMC interface and done basics like text, graphic shapes and images. So the driver is in place I think.
Now I want to introduce Touchgfx to make my GUI lively. But as far as I understand STM32F407 needs external RAM and ROM to store images and full frame buffer to be used by touchgfx to be more effective. Also FreeRTOS and my application code also needs to be added.
So which are the possible ROM and RAM chip options I can use for this purpose. BGA type RAM or high pin count ICS are not practical my case.
Please suggest.
Thank you

Related

Application design recommendations for embedded Raspberry Pi with screen reading GPIO & i2c

I am creating a simple car dashboard cluster using a Raspberry Pi 4 with a 7in screen and using an 8 channel ADC hat and the GPIO pins for sensor input.
The GPIO pins will be used to read the state of various switches in the car using a step down converter so that when a switch is on 12v from that switch will be converted to 3.3V and send to a GPIO pin so it will be high.
The ADC will be used to read the values of various 5V sensors in the car like oil pressure, coolant temp etc.
The screen is a basic HDMI 7in screen with the Pi mounted behind it and I plan to 3D print a new gauge cluster bezel to fit everything into the stock location. I have a Mausberry power controller so that the Pi will turn on with key on and turn off again with key off. I have modified the Pi so it boots from SSD and starts up pretty quickly.
I have used simple Python programs to read the data from the ADC over i2c and the GPIO pins and output it, no issues there. I have found a nice Javascript based library called Justgage which looks like a great way to display my data in a simple HTML page and have designed my page layout with the various gauges and lights that will eventually have the data read from the ADC or GPIO pins.
What I need some advice on is how best to architect the overall solution, I have all the various parts but need to integrate them. I want to minimise the amount of software running on the Pi so it boots quickly.
At the moment when the Pi boots it auto loads Chromium and opens my page I have created but I need a method to be able to read the i2c and GPIO data and then refresh the elements in the HTML page. The Justgage library supports refreshing the data so that I don't have to refresh the page and would like a method to read the data every second or so and then call the Justgage refresh function.
All the examples of this sort of model I can see online use a webserver running on the Pi but as the screen is directly connected to the Pi I don't actually need a webserver and would like to minimise the amount of software running for reliability and boot times.
Sorry for the long first post and appreciate any guidance. Happy to post the HTML if that would be of any help.
Cheers
Matt.

STM32 - ESP8266 download file

i'm using STM32 as my microprocessor along with I2C EEPROM for storage and ESP8266 for Wifi
How can i download an update binary for the bootloader to flash using ESP8266 although the firmware file will be larger than STM32 Ram so i can't load the file from the ESP8266 in one chunk ?
I suppose that you want to update the stm32 firmware.
In this case allow to upload a new binary for the stm32 to the web, store it in the esp8266 file system (it must be bigger than stm32 flash size).
After that, enable flash memory writing, set an small protocol for update stm32 from serial comm from esp8266 the file to stm32 flash.
Remember that all functions that are used to update the stm32 flash must be in RAM.
I'm doing a project for stm32f4 and esp8266 and I will do exactly this.
OPTION 2:
If your program binary size is under 50% of stm32 flash size, then use the above half of the stm32 flash memory to store the new program, after reset, check if there is something there, and if it is then update (this is what i'm doing actually in stm32, very secure method to update since only stm32 cpu is used for update and it is very fast).
I suppose that you have two firmwares on the STM32 flash. First one is boot loader and the second one is your application. Your boot loader gets new firmware over serial interface of the ESP8266; so you can use flow control pins to halt communication until you write the data into flash memory.
I use that combination, stm32 and esp32/esp8266, for now i have not used firmware upgrade from esp (my stm32 supports it but I have not needed it for now).
The easier way is to set a serial protocol between both cpus. I'm using half of the stm32 memory for code and half for updating. What I do actually is using the communication protocolo is copy the file to the upper half of the flash memory. After when i reset the code i check if there is a firmware ready to be updated, then I copy from top half of flash to bottom half.
With this system, you can check if all is ok and the update process with take few ms. After you have this system tested (using for example a PC) you can try to do it from your esp, but it is just as easy as repeat the process.
My tip about the esp8266 is to download the file to a spiffs. If you are not using spiffs, use it, create a drive a little bigger than your memory.. for example if your stm32 firmware binary is around 60kb, and your target cpu is 256, use around 160kb for it.
There is another way, it is download the html file in chunks and then send them to the top half of the cpu, it is not very complex. I would requests chunks with the same size of the block size of your comunnication process (in my case i'm using 256b or 512b, i dont remember at this moment).
Anyways if you have enough spiffs size download the file, update the stm32 cpu, delete the file and send a reboot.
Dont forget to add a crc for data transmision between stm32 and esp8266
Btw you dont need to download it to ram , since update is used rarely and you have limitations like number of times that you can update a flash memory, so, it is not a problem to save it to flash in the esp8266 neither the stm32
Best regards

Backup or read settings of a nucleo board stm32

I was wondering if it is possible to back up or read the settings of a nucleo board stm32. It is set up as a P-NUCLEO-LRWAN1 Nucleo pack. Which uses LoRaWAN to send data to a gateway and it works perfectly. I was now wondering if I could change the configuration (like lora settings, data format, etc).
I already tried using stm32 st-link utility, and Keil IDE. But they only flash or erase the board. I don't know how to read it.
I don't have any background on this so, details would be great. Apologies if I used the wrong words to describe things. Thanks!
You can read memory by "st-link utility" software (if you have st-link, of course)
Under "icon menu" you have two text fields: Address and size. Just set correct address and window below will display necessary memory region.
To save data just Select menu File->Save file...
You need to save it into the FLASH memory. FLASH memory can be erased and programed runtime. Read your micro Reference Manual where the procedure of erasing and writing the FLASH page is described in details.

Can a bad bootloader brick a microcontroller?

My question is, if I manage to develop some kind of bootloader and flash it (is it called that when you put a bootloader on an MCU?), and it works horribly, can it brick the MCU entirely, making it completely unusable, permanently?
The reason I'm asking is that I've been tasked to develop a bootloader for the STM32F407. Problem is, I don't know anything about bootloaders or anything of the sort, which means that I have a lot to learn.
I appreciate any answers, thank you!
In short no you cannot brick a microcontroller with a bootloader.
In the end bootloader is just a firmware and can be erased away using the programmer via SWD
Erase the flash and your controller is as good as new
In general, absolutely, I have a collection of bricked microcontrollers, every so often I get lazy and there goes another.
It is very specific to your microcontroller and family. For example, pin count is very important, as much bang for your buck as you can get, if your microcontroller relies on certain pins for in circuit (or even in a programming fixture) and those pins can be repurposed by software. For example jtag pins that can also be gpio pins. And your code for some reason uses them as gpio pins, AND the design of the chip is such that they cannot use the jtag interface when the chip is in reset, then you can get bricked.
Another very easy one is the pll or clocks in general. If/as you develop code to initialize the clock system (assuming you choose to do that, even if you use chip vendor supplied code) and you have a bug that switches the chip over to a clock that you have not properly initialized or isnt there, it might brick.
Now some chip designs, many, help you out in various ways. The AVR family in general there is a programming mode that happens while the chip is in reset or is related to reset such that whatever code is in flash cannot affect its functionality, you can have a bad board design, sure, but your code cannot prevent it from working. Another method is a "strap" a pin (or pins) that is dedicated to a boot function, set one way normal boot, tie it the other and it goes into an alternate bootloader. This is what you have on the stm32 boot0 and sometimes boot1 depending. that is your get out of jail free card for that chip family, if you brick your chip (pll/clock or mess up the SWD pins by using them as gpio), you "simply" change boot0 and it boots into an internal bootloader (which AFAIK you cant mess up) which is known to work. From that bootloader you can use SWD (chips not bricked now) or the bootloader itself (always serial, sometimes usb or other is supported). NXP similar deal. Atmel ARMs used to have (do have) SAM-BA now they really only support SWD, you can get some samba code and try to lock it into the flash, but way too easy to unlock and or trash that flash, so that is a fail on their part.
As part of your system design if you dont have one of these built into save you from bricking features (like boot0 on an STM32), then I recommend you add one. Very early code initializes a dedicated gpio pin as a strap into your software, if that gpio pin is pulled one way do a normal boot, if pulled the other then spin in an infinite loop or jump to some other guaranteed to not be buggy code. Not a complete guarantee that you wont build the project wrong and trash this code, but it at least allows you to develop your bootloader/project and not brick a tray full of parts/boards as you work through the peripherals that can brick it.
Note letting smoke out of the part is another way to brick it as well, and that can/does happen from time to time as well.
Lots of examples on how to boot an STM32, plus various code from ST that you can use as a starting point as well. (all of which is of various quality, you get what you pay for). Their docs are good, better than some of the competition, not difficult at all to boot and configure their peripherals, sometimes easier than trying to use a canned library. YMMV, you should try various solutions. But if you are new to this, bricking is highly likely, fortunately you have a chip that you cant brick so long as your board design breaks out the boot0 pin. For a prototype board for an STM32 I prefer to have a boot0 button and a reset button, just reset resets the chip and runs, hold boot0 and press reset and it goes into the bootloader. both have to be wired in properly with the right pull up or down as needed for this task. or a jumper works tie boot0 directly high or low then pop reset, costs you more time, but works.
Yes You can brick the Micro controller to never recovered state. I did this and i did it in STM32F427.
Bootloader is all about carefully selecting Clocks, Peripharals and Interrupts priority. if you do this, there are less chances to brick the controller. Also test everything before release your code as some companies wants to save proprietary information to be saved so they blow up the JTAG lines, the only way to program is via Bootloader and if it is not perfect, voila, you just bricked the controller.

arduino +odroid (linaru ubuntu with eclipse and opencv) + usb camera

I hope you can help me. I am trying to build a robot but I am kind of stuck. The Arduino Mega is controlling the stepper motors drivers of the robot. The odroid-x is a single board computer that has installed linaro ubuntu and eclipse c++. All the programming is done in C++ and OpenCV is an image processing library.
The odroid-x has only as input a color camera. Therefore, the information from the camera is received and is processed in eclipse. Then, according to the information that is received, the odroid-x should send different integers to the arduino. The arduino should have a program already uploaded in itself, so it will be waiting for an integer and that integer is going to determine what the arduino is going to send to the drivers.
My questions are the following:
How can I do a serial communication between the arduino and the odroid-x?
How can I send information from eclipse to the arduino with a serial connection?
Thanks so much for any guide you can give me
First, be very, very, very careful. The ODROID boards use 1.8V signalling, so hooking up your 3.3V or 5V Arduino to the pins that expect no more than 1.8V will give you a burnt ODROID-X. It is possible to hook these two boards together if you put a level converter between them, and Sparkfun and Adafruit have some of those converters available. There is even a 1.8V reference voltage pin available... one of the pins that go to the LCD panel RGB-to-LVDS converter board puts out a constant 1.8V.
You could use either the four pins of the little white connector, or UART1, as a serial port, or you can use some of the pins in the 50-pin GPIO block as UART4. There are board schematics available on Hardkernel's website. These two UARTs show up as /dev/ttySAC0 (UART1) and /dev/ttySAC3 (UART4).
I don't know how to talk to those UARTs from a program, personally, but I know there are serial communications libraries available for python from watching threads pop up on the ODROID forums.