You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
127 lines
5.4 KiB
127 lines
5.4 KiB
# KED: Wellcome to Kerem and Edwin's Develeppoment platform.
|
|
|
|
|
|
# Workflow
|
|
##TODO: (In Chronological Form)
|
|
+ Implementing interrupt
|
|
+ Timer Together
|
|
+ GPIO Together/Alone
|
|
+ SPI Edwin
|
|
+ I2C Kerem
|
|
+ PWM Inlcuding Interrupts (Edwin &| Kerem)
|
|
+ Test KED with Reflow Oven
|
|
+ DMA
|
|
|
|
## Introduction:
|
|
### Why ?
|
|
This project is made to enable high portability between different Plaftorms an MCU's awailable on the market.
|
|
The main motivation was the chip allocation that started on 2018 and will most propably continue until 2024.
|
|
|
|
### But how come that we don't use the code renerators and IDEs proposed from the manufacturters ?
|
|
The answer is pretty simple :
|
|
+ We want this library to be portable between different manufacturers who uses arm cores.
|
|
+ To give us the ability to write and test our code on a raspberry and then simply implement the same code on your MCU.
|
|
+ To give us the opportunity the crate your own Board Support Layer based (BSL) on mutiple MCU if needed. Thus allowing us to adapt to a highly aggresive market.
|
|
+ An abstration layer that doesn't chnage between MCU's and BSL's with the miminun possible overhead as possible.
|
|
|
|
# How does it work ?
|
|
KED is intendet to be used as a git submodule. Allowing the mainternars of KED to do their things, while letting you to focus on your own project.
|
|
### Before you ask, Of Course, Yes, you would be one of our heroes if you decide to be a contributor !
|
|
|
|
|
|
# What is KED?
|
|
KED is a framework created by Kerem Yollu and Edwin Koch. KED stands for
|
|
"Kerem and Edwin Developement". The idea was initially started by the desire to create a hardware
|
|
abstraction layer (HAL) as the given ones are mostly bloated and not well structured.
|
|
|
|
# KED structure
|
|
This section will explain how KED is structured and how you can implement drivers, peripherals,
|
|
etc.
|
|
|
|
# Chip Support Layer (CSL)
|
|
The CSL folder holds all the target device specific resources and implementations. For example if
|
|
you want to use the NUCLEO 042k6 you have to choose the target device "stm32f042k6t6" as this is
|
|
the physical IC used by the NUCLEO board. This target device is represented inside CSL folder as a
|
|
folder named with the target device. This is crucial as there can be differeces between different
|
|
packages with the same IC core e.g "stm32f042k6t6" vs "stm32f042f6p6". Both of them are the "same"
|
|
but have different pin mappings and even differing peripheral structures.
|
|
|
|
## Hardware Description Layer
|
|
This is a subfolder inside each target device folder. It holds all the specific hardware
|
|
description headers e.g "hwd_pin.h". These HWD files describe e.g. how many pins there are, how
|
|
many timers there are, etc. If one target device does not have a specific peripheral e.g. CAN bus
|
|
then its HWD file is not put inside the folder.
|
|
|
|
## Implementing new target device
|
|
To implement a new target device to KED please follow the following steps in this section. Each
|
|
subsection will explaine how the structure is defined and what has to be implemented sothat at the
|
|
end there is a fully implemented
|
|
|
|
## Main structure of target device resources
|
|
Each target device has its own folder in which all the resorces and device specific implementations
|
|
are located. This folder is located to
|
|
in the csl folder of KED
|
|
|
|
## Implementing Peripherals
|
|
First create a folder with the spesific IC name. E.g. stm32f042k6t6 (used on the NUCLEO F042K6).
|
|
In this folder
|
|
TODO -> explain how to implement periperals and include
|
|
|
|
INTERFACES
|
|
|
|
- pin
|
|
- pin.h Is now only missing interrupt functions
|
|
- USART
|
|
- usart.h Is working Great But there are many more functionalities to be added.
|
|
- usart.h Interrupt and DMA are the next steps
|
|
|
|
- deviceSetup
|
|
- deviceSetup.h it's a copy of what ST has made but wit direct register acsess
|
|
- deviceSetup.h we need to test it with other configurations to see if it works as
|
|
supposed or if the MCU is on it's defaul 8MHz congif.
|
|
- setupInit(); funtion is called from bsl/csl/stm32f042/startup/startup_stm32f042x6.s
|
|
and is called before the main();
|
|
|
|
PROGRAMMING
|
|
|
|
- CPP
|
|
- CPP Classes are taking extreme ammount of code ! 5kB for one class
|
|
- Try to generate a CPP proect with cube to sse if we are missing some flags.
|
|
- Huge difference i we use main.c or main.cpp as enrty point. somehow the first intoduction of classes are taking env. 5Kb
|
|
|
|
|
|
DOCUMENTATION
|
|
|
|
- STM-Flash utility
|
|
- https://www.mankier.com/1/st-flash#Options
|
|
- erasing flash ```st-flash erase```
|
|
- Fun with Linus and why he only wants C
|
|
- https://www.realworldtech.com/forum/?threadid=104196&curpostid=104299
|
|
|
|
TOOLS
|
|
|
|
- #### **`run.sh`** will compile and load the code directly to your device. It also creates
|
|
and/or updates the Doxygen documentation of the code.
|
|
It can also be used used just for compiling.
|
|
- #### **`tmux-dev.sh`** will automatically create the different "workbenches" for easy
|
|
workflow.
|
|
|
|
|
|
HELPEFULL STUFF
|
|
|
|
- [tmux cheat sheet](https://tmuxcheatsheet.com)
|
|
- pinout of stm32f04k6 nucleo
|
|
![pinout][https://www.e-komponent.com/stm32f031k6-mbed-enabled-development-nucleo-32-stm32f0-arm-cortex-m0-mcu-32-bit-embedded-evaluation-board]
|
|
|
|
REFRESHERS
|
|
- tmux stuff
|
|
- change frame with `Ctrl+B W`. A widnow with a preview will open. Coose eather by moving
|
|
selection via cursor and the presseing `enter` or bynumber
|
|
|
|
|
|
|
|
RESTRUCTURATION 02_08_2023:
|
|
- Maybe : Separate the pripherals trio : Ex : i2c.h i2c.c imp_i2c.h as -> i2c.h i2c.c csl_i2c.h cls_i2c.c
|
|
- This mitigates confusion for end user and hides away complexity.
|
|
|