Compare commits

...

8 Commits

Author SHA1 Message Date
rusefillc 2500cb30b4 fresh 2023-05-24 11:49:14 -04:00
rusefillc b5ebdf050b progress 2023-05-24 11:48:32 -04:00
rusefillc 7678dc02d5 fresh 2023-05-24 11:21:17 -04:00
rusefillc 45d8004703 progress 2023-05-24 11:21:17 -04:00
rusefillc e96f0e13bf
Update README.md 2023-05-24 10:14:15 -04:00
rusefillc 6a25e6f861 fresh 2023-05-24 10:12:28 -04:00
rusefillc 34f280e4b8 progress 2023-05-24 10:12:16 -04:00
rusefillc c4aaf4e41c docs 2023-05-24 10:10:16 -04:00
5 changed files with 68 additions and 3 deletions

View File

@ -9,3 +9,5 @@ typedef enum {
BOR_Level_2 = 2,
BOR_Level_3 = 3
} BOR_Level_t;
#define PORT_SIZE 16

View File

@ -1,10 +1,28 @@
# Current state
Some skeleton compiles but does not even link yet. nothing else
# fw-AT-START-F435
An attempt to blink an LED on AT-START-F435 board using ChibiOS+rusEFI codebase
* https://github.com/rusefi/rusefi/tree/master/firmware/config/boards/cypress and https://github.com/rusefi/rusefi/tree/master/firmware/config/boards/kinetis are examples of custom platform for ChibiOS
* only difference with above mentioned cypress and kinetis is here we are trying to build on top of rusEFI as a submodule
* only difference with above mentioned cypress and kinetis is here we are trying to build on top of rusEFI as a git submodule
* see 'ext/AT32F435_437_Firmware_Library' for Artery firmware library
![image](https://github.com/rusefi/fw-AT-START-F435/assets/48498823/81af22f5-1581-429a-a370-377ecf8afcb8)
Current state: just some skeleton progress nothing else
# Artery Documentation
https://www.arterychip.com/download/ARTERY_AT32_MCU_Cross_Reference_Table_EN_V202011.xlsx
https://www.arterytek.com/download/MG0003_Migrating_from_SXX32F103_to_AT32F413_EN_V1.0.6.pdf
https://www.arterytek.com/download/MG0007_Migrating_from_SXX32F103_to_AT32F403A_EN_V1.0.8.pdf
https://www.arterytek.com/download/MG0009_Migrating_from_SXX32F107_to_AT32F407_EN_V1.0.4.pdf
https://www.arterytek.com/download/MG/MG0018_Migrating_from_AT32F403A_407_to_AT32F435_437_EN_V2.0.3.pdf
https://www.arterychip.com/download/APNOTE/AN0128_AT32F435_437_Get_started_guide_EN_V2.0.0.pdf

@ -1 +1 @@
Subproject commit 2b46656c125b7e83bf0849733fb8e1f66cfaf1da
Subproject commit b53c05ada03180ef60a4fa781960e2d605aef645

View File

@ -1 +1,4 @@
MCU = cortex-m4
HW_LAYER_EMS_CPP += $(ARTERY_CONTRIB)/../mpu_util.cpp

42
mpu_util.cpp Normal file
View File

@ -0,0 +1,42 @@
/**
* @file mpu_util.cpp
*/
#include "pch.h"
void baseMCUInit(void) {
}
// copy-paste of stm32 method? reuse code?
brain_pin_e parseBrainPin(const char *str) {
if (strEqual(str, "none"))
return Gpio::Unassigned;
// todo: create method toLowerCase?
if (str[0] != 'p' && str[0] != 'P') {
return Gpio::Invalid;
}
char port = str[1];
brain_pin_e basePin;
if (port >= 'a' && port <= 'z') {
basePin = Gpio::A0 + PORT_SIZE * (port - 'a');
} else if (port >= 'A' && port <= 'Z') {
basePin = Gpio::A0 + PORT_SIZE * (port - 'A');
} else {
return Gpio::Invalid;
}
const char *pinStr = str + 2;
int pin = atoi(pinStr);
return (brain_pin_e)(basePin + pin);
}
ioportid_t * getGpioPorts() {
return nullptr;
}
uint32_t getTimeNowLowerNt() {
return 0;// TODO: at32 port_rt_get_counter_value();
}
unsigned int getBrainPinOnchipNum(void) {
return BRAIN_PIN_ONCHIP_PINS;
}