This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ALTERA_PATH=~/altera/13.1/ | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install gcc-multilib g++-multilib \ | |
lib32z1 lib32stdc++6 lib32gcc1 \ | |
expat:i386 fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 libgtk-3-0:i386 \ | |
libcanberra0:i386 libpng12-0:i386 libice6:i386 libsm6:i386 libncurses5:i386 zlib1g:i386 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
/*************************************************************************** | |
* Helper Types | |
***************************************************************************/ | |
/* Basic example person data structure. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This might also work for other STM32 chips. I use the HAL, so it also might be supported by your chip. | |
To use the Backup SRAM (most of the time 4 Kb), you need to add a backup power source (like a battery or a supercap) | |
to the VBAT pin of your STM32. I use a simple CR2032 battery. | |
Use following code to get access to the Backup SRAM: | |
__HAL_RCC_PWR_CLK_ENABLE(); | |
HAL_PWR_EnableBkUpAccess(); | |
__HAL_RCC_BKPSRAM_CLK_ENABLE(); |