GithubHelp home page GithubHelp logo

sky_div's Introduction

Hardware:

STM32 comtroller. There are code for STM32F103C8, STM32L476RG, STM32G031K8
SSD1305 OLED display. Resolution 72x40
BME280 sensor for getting a temperature, pressure and humidity 3 buttons

Software

I use Segger Embedded Studio for develop and j-Link debugger
Project is generated by STMCubeMX

How to use Segger Embedded Studio for develop STM32 projects:

  • Create a project in CubeMX and output the code for EWARM IAR. Most likely IAR should be installed, but you need to check
  • Copy the EWARM folder next to the same under the name SES
  • In SES-> Package manager, install the support package for the desired microcontroller (STM32F103 for example)
  • Enter SES-> File-> Import {roject-> IAR EWARM-> Internal tollcahin (with other import options, the IAR limitation on the amount of code of the educational version 32Kb will be applied)
  • Compile the project
  • Remove *.eww, *ewd, *.ewp from the SES folder
  • Pull into this folder: STM32F103xx_Registers.xml from c: \ Users \ boss \ AppData \ Local \ SEGGER \ SEGGER Embedded Studio \ v3 \ packages \ STM32F1xx \ XML \
  • Connect the STM32F103xx_Registers.xml file in options-> Debugger-> register definition files
  • Remove from project files: Cortex_M_Startup.s and add: STM32F1xx_Startup.s and STM32F103xx_Vectors.s. The last one is especially insidious: it compiles without it, but due to the absence of an interrupt vector table, when entering any interrupt, we fall into HardFault (which is described in Cortex_M_Startup.s)
  • Can be compiled and debugged The control transfer chain at startup: reset_handler '' in the STM32F1xx_Startup.s file, then _start '' to SEGGER_THUMB_Startup.s, and from there to `` PP_ENTRY_POINT```, which is the input to main ( )

Как использовать Segger Embedded Studio для разработки STM32-проектов:

  • Создать проект в CubeMX и вывести код для EWARM IAR. Скорее всего IAR должен быть установлен, но нужно проверить
  • Скопировать папку EWARM рядом же под именем SES
  • В SES->Package manager установить пакет поддержки нужного микроконтроллера(STM32F103 например)
  • Войти в SES->File->Import {roject->IAR EWARM->Internal tollcahin (при других вариантах импорта будет дейсвовать ограничение IAR на объем кода учебной версии 32Кб)
  • Скомпилировать проект
  • Удалить из папки SES *.eww, *ewd, *.ewp
  • Стянуть в эту папку: STM32F103xx_Registers.xml из c:\Users\boss\AppData\Local\SEGGER\SEGGER Embedded Studio\v3\packages\STM32F1xx\XML\
  • Подключить файл STM32F103xx_Registers.xml в options->Debugger->register definition files
  • Из файлов проекта удалить: Cortex_M_Startup.s и добавить: STM32F1xx_Startup.s и STM32F103xx_Vectors.s. Особенно коварный последний: без него компилируется, но ввиду отсутствия таблицы векторов прерывания при входе в любое прерывание падаем в HardFault (которое ксати описано в Cortex_M_Startup.s)
  • Можно компилировать и отлаживать
    Цепочка передачи управления при запуске: reset_handler в файле STM32F1xx_Startup.s, затем _start в SEGGER_THUMB_Startup.s, а оттуда в PP_ENTRY_POINT , что и есть вход в main()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.