|
發表於 2017-6-14 00:20:38
|
顯示全部樓層
本文章最後由 peter5438 於 2017-6-14 12:53 AM 編輯
By: Ralim My Country: Australia
I have used the STM32 devices a little bit beforehand so it wasn't tooo bad.
If you have a background with C/C++ most of it is fairly easy to understand (If you don't, probably easier to walk through some tutorials).
For history :
The original firmware was written to be compiled in IAR, which costs $$$.
openstm32.org have created System Workbench for STM32. Which is a nicely packaged up eclipse + compiler setup for the STM32 series of processors. Built upon GCC, which is not as amazing at optimisation as IAR, but its FOSS.
First I use STM CubeMX from STM, which lets you load the pinouts for a chip and generate setup code for the chip. I setup the pinmap to match the schematics that miniDSO released for the TS100. This then allowed me to check that they did indeed put the I2C bus on pins that can actually drive I2C (original software bit-banged the bus in software). They also did put the mosfet control for the heating element on a hardware PWM capable pin.
From there I took their original code and commented through it to understand how it functioned. This included a lot of head scratching to figure out why the created some of the code how they did (almost all functions were done in software, no special hardware usage).
Once I understood the rough flow of the original software, I started working on getting it to compile in the systemWorkbench software. Which was only a few minor changes to the build system. However GCC could not compile their existing firmware to fit onto the IC (As the USB drive function required about 32K of flash to store the USB system). I had begun this project looking to remove the USB requirement for changing settings on the unit, so quickly cutting the code for this out was a no-brainer.
With the USB removed the code now fitted into the flash on the device, so I uploaded the .hex file using the bootloader, which worked (ie the unit still functioned, however no USB).
Skipping over a few nights of progressively changing the unit, I basically went through all of their functions and replaced / re-write most of them to use hardware features.
How to edit
For editing / adding features to the unit, I have attempted to create functions for access to most of the features inside the unit. I am more than willing to add more if required.
To edit the code you will need to install the system workbench software. Then use the "import existing project into workspace"
Once the project has been imported you should be able to build the software, and in the output folder will be a .hex file you can load onto the soldering iron.
^ There are a few tutorials online for getting started with the STM32 online, and I basically used these for a lot of the process.
-----------------------------------------------------------------------------------------------------------
FOSS: Free and open-source software
IAR Systems:
IAR Systems is a Swedish computer software company that offers development tools for embedded systems. IAR Systems was founded in 1983, and is listed on NASDAQ OMX in Stockholm. "IAR" is an abbreviation of Ingenjörsfirman Anders Rundgren, which means Anders Rundgren Engineering Company.[1]
IAR Systems develops C and C++ compilers, debuggers, and other tools for developing and debugging firmware for 8-, 16-, and 32-bit processors. The company started out in the 8-bit market, but moved into the expanding 32-bit market, especially the market for 32-bit microcontrollers.
IAR Systems operates in Germany, France, Japan, South Korea, China, United States, United Kingdom, Brazil, Sweden, as well as through distributors abroad. The company is headquartered in Uppsala, Sweden and has over 150 employees.
Embedded Workbench — a development environment that includes a C/C++ compiler and debugger that supports 30 different processor families
visualSTATE — a design tool for developing event-driven programming systems based on the state machine paradigm. IAR visualSTATE presents the developer with the state machine subset of UML for C/C++ code generation. By restricting the design capabilities to state machines it is possible to employ formal model checking to find and flag unwanted properties like state dead-ends and unreachable parts of the design. It is not a full UML editor.
IAR KickStart Kit — a series of software and hardware evaluation environments based on various microcontrollers.
The development tools support the following targets: 78K, 8051, ARM, AVR, AVR32, CR16C, Coldfire, H8, HCS12, M16C, M32C, MSP430, Maxim MAXQ, R32C, R8C, RH850, RL78, RX, S08, SAM8, STM8, SuperH, V850.[2] The supported ARM core families are: ARM7 / ARM9 / ARM10 / ARM11, Cortex M0 / M0+ / M1 / M3 / M4 / M7 / M23 / M33, Cortex R4 / R5 / R7, Cortex A5 / A7 / A8 / A9 / A15 / A17.
GCC, the GNU Compiler Collection
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system. The GNU system was developed to be 100% free software, free in the sense that it respects the user's freedom.
We strive to provide regular, high quality releases, which we want to work well on a variety of native and cross targets (including GNU/Linux), and encourage everyone to contribute changes or help testing GCC. Our sources are readily and freely available via SVN and weekly snapshots.
Major decisions about GCC are made by the steering committee, guided by the mission statement.
Eclipse是著名的跨平台開源整合式開發環境(IDE)。最初主要用來Java語言開發,目前亦有人通過外掛模組使其作為C++、Python、PHP等其他語言的開發工具。
Eclipse的本身只是一個框架平台,但是眾多外掛模組的支援,使得Eclipse擁有較佳的靈活性,所以許多軟體開發商以Eclipse為框架開發自己的IDE。
外國就有這麼多, 像我一樣, 吃飽沒事做的人!!! :sam14
|
評分
-
3
查看全部評分
-
|