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.
Related
I'm playing around with the board in the question and I'm struggling with it even though I'm fairly familiar with the F767 Nucleo. What I want:
to reprogram the demo that came on to the board for now, as I haven't managed to get the display on the board working at all since before then. I've downloaded the stm32f769 disco demo that includes the appropriate .HEX
What I've done:
I've upgraded st-link using the upgrade utility. Within STM32 Cube programmer, I've selected the appropriate External Loader for my disco board. My board is connected via st-link and is recognised by cube programmer.
On the erasing and Programming tab I've selected the correct .HEX file and the device begins to program. The file is about 120MB and so takes a good while to program.
Once the programming has complete, cube programmer tells me that it was successful. However the screen is just displays the blue ST logo on a white background and nothing else. Nothing changes when tapping the screen or pressing the reset button (apart from a reset of course).
Any help would be appreciated, something simple as programming the board shouldn't be this difficult so I'm clearly doing something wrong.
Have you read the readme.txt?
Did you click on "External Loader" from the bar menu then check "MX25L512G_STM32F769I-DISCO" box?
because you need to flash the QSPI together with the internal 2MB memory.
Taken from the readme.txt in the downloadable zip.
#par How to use it ?
The QSPI external flash loader is not integrated with supported toolchains, its only supported with STM32
ST-Link Utility V3.9 or later
To load the demonstration, use STM32 ST-Link Utility to program both internal Flash and external QSPI memory.
To edit and debug the demonstration you need first to program the external QSPI memory using STLink utility
and then use your preferred toolchain to update and debug the internal flash content.
In order to program the demonstration you must do the following:
1- Open STM32 ST-Link Utility, click on "External Loader" from the bar menu then check
"MX25L512G_STM32F769I-DISCO" box
2- Connect the 32F769IDISCOVERY board to PC with USB cable through CN16
3- Use "STM32769I-DISCO_DEMO_VX.Y.Z_FULL.hex" file provided under Binary with STM32 ST-Link Utility
to program both internal Flash and external QSPI memory. this demo to take benefit from Touch-GFX
and EmbeddedWizard third parties demonstrations modules replacing Gardening control and Home alarm modules.
4- copy the audio and video files provided under "Media/" in the USB key
5- Plug a USB micro A-Male to A-Female cable on CN15 connector
6- Plug a headphone into CN7 Connector.
-> The internal Flash and the external QSPI are now programmed and the demonstration is shown on the board.
I have designed and assembled a PCB. All connections are fine and leds are blinking when i open the CUBEMX. But I don't know what to do after this point. Do I need to put some drivers before using DFU?
If so, i don't have an ST-LINK Programmer how can i use the only input for this pcb (which is PB11,PB12 as AN2662 suggests). Its also interesting that device is responding to CubeMX . Does device has any code in it?
MCU :
STM32F405RGT6
Your question is not clear. But i will try to answer to your question with my understanding from the question. First thing that you need to find the datasheet of mcu. Now, you can able to find related pins for programming. Using these pins, you can program your hw.
if you want to put dfu mode to your hw, Please check "Application Note 2606 STM32 microcontroller system memory boot mode".
Also, i wrote post about system memory bootloader, here is the link: https://engineeringvolkan.wordpress.com/2020/05/08/1928/
If I understood well, you want to learn how to upload code into your uC. If you are not familiar with DFU, I suggest that you can use ST LINK V2. However, the important point is whether, or not you put output terminals for SW pins (SWDIO, NRST, SWCLK, SWO).
For the DFU, you should check Bootloader properties and bootloader configurations specifcally related to your uC. After these, you can watch this video EEVBlog STM32 DFU and inspire from it.
My STLINKV2 is not working anymore, not detected by Linux, it failed after the first successful flash. I ordered a new one but it will take 60+ days to arrive. Meanwhile I have heard on Youtube you can program Bluepills directly by connecting cut open USB cable to certain pins and then using a jumper. But I cannot get any precie information on this, is this really possible and how?
You should use the embedded bootloader. You can flash it through several interfaces. Look at AN2606, maybe you can find an already written flasher. Good luck STM32CubeProgrammer handle it.
If you intend to program it through usb, look also at AN3156 all protocols document are referred in chapter 2 of AN2606
THOSE AREN'T CUT OPEN USB CABLES they are USB to serial adapters for arduino's bootloader
They connect them like this:
The problem is that this requires the Arduino STM32 bootloader to be flashed in it.
Another option will be to use STM32CubeProg this program allows you to program your stm over
Serial
SPI
I2C
USB
You'll need to set the BOOT0 and BOOT1 pins to the correct value (HIGH slash LOW) to allow it to go in flash mode during boot.
Here is semi outdated tutorial which tells most of the steps to program a STM using serial. (the Flash Loader Demonstrator is outdated and you should use STM32CubeProg)
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
The SDK provided along with NFC reader does not work and we are not able to write data / tag using the Tools available with SDK. The main issue is that the data written using another tool does not remain in the device for permanently. When tag is scanned using Android device, reader gets clear and we have to to write data again.
I have checked and tried instructions from https://github.com/fkooman/nfcip-java/blob/master/nfcip-java/doc/ACR122_PN53x.txt but it does not work.
So, we need help to understand what command is needed to keep data(tag) in Reader even if it has been unplugged from the computer. The reader needs to be working in emulation mode and should provide tags.
I know this is old but ranked in google so...
The ACR122U does not have any memory so it cannot save any state. You need to use it as you mentioned - writing to the device on each use.
Hope it helps someone.
First of all, the ACR122U was mainly designed as a contactless smartcard reader and not as a card emulator. However, it is possible to do host-based card emulation (HCE) with this device (see How to card emulate with ACR122U-A9). But note that there are issues with some versions of the ACR122U (e.g., see The PN532 configured as target has been released by its initiator).
Nevertheless, all this is host-based card emulation. So the ACR122U only acts as the contactless front-end for emulating a tag (or contactless smartcard). It's the host (the computer) to which the ACR122U is connected to that performs the actual emulation.
Thus, the ACR122U is not a stand-alone device that you could program to act as a tag. You always need an application running on the computer that is connected to the ACR122U (via USB) to perform the actual emulation.