Stm32f notes sections 3p1 a 3p4

From Wiki at Neela Nurseries
Jump to: navigation, search

^ STMicro standard peripheral libraries

☆ * * NEED TO MOVE THIS STM32F DOC SECTION TO STM32F100 NOTES PAGE ON WIKI * * *

A search at st.com for the header file stm32f10x.h results in two app notes type documents from ST.

  • STSW-STM32020 . . . i2c driver demo for stm32F1xxx and other micros,


Side note: linker files such as ~/Downloads/stm/an3268/stm32vldiscovery_package/Project/Demo/TrueSTUDIO/DISCOVER/STM32F100RB_FLASH.ld describe among other things the memory types, starting addresses and ranges of ST microcontrollers, and probably other manufacturers' microcontrollers too.


^ Crafting makefile for SCD30 demo

GNU make define directive:

Also good to know are GNU `make` functions $(error ...) $(warning ...) and $(info ...):

Detailed logging of compilation, as in `$ make all install 2>&1 | tee make.log` . . . :


^ NOP function and to implement microsecond delays

What we're really looking for here is micro-second accurate delay function . . .

/opt/lib/an3268/stm32vldiscovery_package/Project/Examples/SysTick$ ls -l
total 40
drwxr-xr-x 2 user user 4096 Oct 18  2010 EWARMv5
drwxr-xr-x 2 user user 4096 Oct 18  2010 MDK-ARM
drwxr-xr-x 4 user user 4096 Oct 18  2010 TrueSTUDIO
-rw-r--r-- 1 user user 3810 Sep 13  2010 main.c
-rw-r--r-- 1 user user 1626 Sep 13  2010 main.h
-rw-r--r-- 1 user user 2375 Sep 13  2010 readme.txt      <-- check this file, refers to implementing one microsecond delay based on 24MHz clock
-rw-r--r-- 1 user user 3228 Sep 13  2010 stm32f10x_conf.h
-rw-r--r-- 1 user user 4346 Sep 13  2010 stm32f10x_it.c
-rw-r--r-- 1 user user 1888 Sep 13  2010 stm32f10x_it.h


- 2018-05-01 Tuesday -

ST documentation on STM32F timers:


^ Build and assembly issues

Getting errors as though assember arm-none-eabi-as doesn't understand project assembly file comment lines, those which begin with ';':

$ make
*** In demo-systick.elf target variable (CC) holds 'arm-none-eabi-gcc',
*** and variable (AS) holds 'arm-none-eabi-as',
arm-none-eabi-gcc -g -O2 -Wall -T/opt/lib/an3268/stm32vldiscovery_package/Project/Examples/SysTick/TrueSTUDIO/stm32_flash.ld -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=soft -I. -I/opt/lib/an3268/stm32vldiscovery_package/Utilities/STM32F4-Discovery -I/opt/lib/an3268/stm32vldiscovery_package/Utilities -I/opt/lib/an3268/stm32vldiscovery_package/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x -I/opt/lib/an3268/stm32vldiscovery_package/Libraries/STM32F4xx_StdPeriph_Driver/inc -I/opt/lib/an3268/stm32vldiscovery_package/Libraries/CMSIS/CM3/CoreSupport main.c stm32f10x_it.c startup_stm32f10x_md_vl.s -o demo-systick.elf

startup_stm32f10x_md_vl.s: Assembler messages:
startup_stm32f10x_md_vl.s:1: Error: junk at end of line, first unrecognized character is `*'
startup_stm32f10x_md_vl.s:2: Error: junk at end of line, first unrecognized character is `*'
startup_stm32f10x_md_vl.s:3: Error: junk at end of line, first unrecognized character is `*'
startup_stm32f10x_md_vl.s:4: Error: junk at end of line, first unrecognized character is `*'
   .
   .
   .

Reference: https://stackoverflow.com/questions/46106166/assembler-messages-error-junk-when-running-as-on-linux


- 2018-05-02 WED -

Here is an interesting directory in terms of ARM target libraries, and seeming mention of linker scripts:

   $ pwd

   /usr/lib/arm-none-eabi

   $ ls

   bin  include  ldscripts  lib  newlib


^ STM32F register set up and use references

2018-05-07 - Is the following like assignment following the #else an error in file stm32f10x.h? . . .

 125 
 126 /**
 127  * @brief Configuration of the Cortex-M3 Processor and Core Peripherals
 128  */
 129 #ifdef STM32F10X_XL
 130  #define __MPU_PRESENT             1 /*!< STM32 XL-density devices provide an MPU */
 131 #else
 132  #define __MPU_PRESENT             0 /*!< Other STM32 devices does not provide an MPU */
 133 #endif /* STM32F10X_XL */
 134 #define __NVIC_PRIO_BITS          4 /*!< STM32 uses 4 Bits for the Priority Levels    */
 135 #define __Vendor_SysTickConfig    0 /*!< Set to 1 if different SysTick Config is used */
 136