Difference between revisions of "Stm32f notes sections 3p1 a 3p4"

From Wiki at Neela Nurseries
Jump to: navigation, search
(2018-06-13 - Tuesday, Ted moving early STM32F notes from the LPCXpresso article on Neela Nurseries wiki.)
 
m (formatting, remove empty lines.)
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
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.
 
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.
 
</i>
 
</i>
 
  
 
<!-- comment -->
 
<!-- comment -->
Line 30: Line 29:
  
 
*  https://gcc.gnu.org/ml/gcc-help/2002-05/msg00029.html
 
*  https://gcc.gnu.org/ml/gcc-help/2002-05/msg00029.html
 
  
 
<!-- comment -->
 
<!-- comment -->
Line 45: Line 43:
 
/opt/lib/an3268/stm32vldiscovery_package/Project/Examples/SysTick$ ls -l
 
/opt/lib/an3268/stm32vldiscovery_package/Project/Examples/SysTick$ ls -l
 
total 40
 
total 40
drwxr-xr-x 2 veris veris 4096 Oct 18  2010 EWARMv5
+
drwxr-xr-x 2 user user 4096 Oct 18  2010 EWARMv5
drwxr-xr-x 2 veris veris 4096 Oct 18  2010 MDK-ARM
+
drwxr-xr-x 2 user user 4096 Oct 18  2010 MDK-ARM
drwxr-xr-x 4 veris veris 4096 Oct 18  2010 TrueSTUDIO
+
drwxr-xr-x 4 user user 4096 Oct 18  2010 TrueSTUDIO
-rw-r--r-- 1 veris veris 3810 Sep 13  2010 main.c
+
-rw-r--r-- 1 user user 3810 Sep 13  2010 main.c
-rw-r--r-- 1 veris veris 1626 Sep 13  2010 main.h
+
-rw-r--r-- 1 user user 1626 Sep 13  2010 main.h
-rw-r--r-- 1 veris veris 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 2375 Sep 13  2010 readme.txt      <-- check this file, refers to implementing one microsecond delay based on 24MHz clock
-rw-r--r-- 1 veris veris 3228 Sep 13  2010 stm32f10x_conf.h
+
-rw-r--r-- 1 user user 3228 Sep 13  2010 stm32f10x_conf.h
-rw-r--r-- 1 veris veris 4346 Sep 13  2010 stm32f10x_it.c
+
-rw-r--r-- 1 user user 4346 Sep 13  2010 stm32f10x_it.c
-rw-r--r-- 1 veris veris 1888 Sep 13  2010 stm32f10x_it.h
+
-rw-r--r-- 1 user user 1888 Sep 13  2010 stm32f10x_it.h
 
</pre>
 
</pre>
  
Line 62: Line 60:
  
 
*  http://www.st.com/content/ccc/resource/technical/document/application_note/group0/91/01/84/3f/7c/67/41/3f/DM00236305/files/DM00236305.pdf/jcr:content/translations/en.DM00236305.pdf
 
*  http://www.st.com/content/ccc/resource/technical/document/application_note/group0/91/01/84/3f/7c/67/41/3f/DM00236305/files/DM00236305.pdf/jcr:content/translations/en.DM00236305.pdf
 
  
 
<!-- comment -->
 
<!-- comment -->
Line 103: Line 100:
 
   bin  include  ldscripts  lib  newlib
 
   bin  include  ldscripts  lib  newlib
 
</pre>
 
</pre>
 +
 +
<!-- comment -->
 +
 +
== [[#top|^]] STM32F register set up and use references ==
 +
 +
*  http://hertaville.com/stm32f0-gpio-tutorial-part-1.html
 +
**  https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MXOSA2  . . . push-pull output versus open collector
 +
 +
2018-05-07 - Is the following like assignment following the #else an error in file stm32f10x.h? . . .
 +
 +
<pre>
 +
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
 +
</pre>
 +
  
  
 
<!-- comment -->
 
<!-- comment -->

Latest revision as of 19:12, 23 February 2024

^ STMicro standard peripheral libraries

&star; * * 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