From 8f01c8895e846b1aae6861af857e662e4af9ed0c Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 28 May 2025 15:16:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BD=D0=B0=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2=20=D0=B8=20=D1=83=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B9=D1=81=D1=82=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/AT32F437xM_FLASH.ld | 4 +++- APP/main.c | 37 +++++++++---------------------------- artery_f437.cfg | 13 +++---------- modular.json | 35 ----------------------------------- 4 files changed, 15 insertions(+), 74 deletions(-) diff --git a/APP/AT32F437xM_FLASH.ld b/APP/AT32F437xM_FLASH.ld index 528fc95..ae5cdf4 100644 --- a/APP/AT32F437xM_FLASH.ld +++ b/APP/AT32F437xM_FLASH.ld @@ -23,6 +23,7 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ _estack = 0x20080000; /* end of RAM */ +/*_estack = 0x20060000;*/ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ @@ -31,7 +32,8 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ _FullFirmwareSize = 1024K ; _MetadataSize = 256 ; _FirmwareSize = _FullFirmwareSize - _MetadataSize ; -_FirmwareBegin = 0x08100000; +/*_FirmwareBegin = 0x08100000;*/ +_FirmwareBegin = 0x08000000; /* Specify the memory areas */ MEMORY diff --git a/APP/main.c b/APP/main.c index 395cae6..a0cb47d 100644 --- a/APP/main.c +++ b/APP/main.c @@ -99,9 +99,10 @@ osMessageQueueId_t EthDataQueue; // ++a; //} +void mx_clkout1_init(); + int main(void) { system_clock_config(); - // asm(".rept 2 ; bl loop ; .endr"); asm("nop"); asm("nop"); @@ -109,13 +110,10 @@ int main(void) { asm("nop"); asm("nop"); - memset(bufFreeOperation, 0, sizeof(bufFreeOperation)); memset(bufFreeOperationKV, 0x56, sizeof(bufFreeOperationKV)); memset(bufFillOperation, 0x55, sizeof(bufFillOperation)); -// extend_sram(); - // md5a_context md5ctx; // uint8_t md5sum[16]; @@ -136,35 +134,13 @@ int main(void) { InitPeripheralInterfaces(); - /* - struct tm dateTime; - memset(&dateTime, 0, sizeof(dateTime)); - dateTime.tm_year = 123; - dateTime.tm_mon = 0; - dateTime.tm_mday = 1; - dateTime.tm_hour = 0; - dateTime.tm_min = 0; - dateTime.tm_sec = 0; - RTCS.rtcI0.setTM(&RTCS, &dateTime); -*/ - - Mma_Init(&MAIN_ENV, &GPIOS, &ADCS, &SERIAL_PORTS, &SPI_PORTS, &RTCS, &NVM_STORAGE, &FIRMWARE_MAIN_LOADER, + Mma_Init(&MAIN_ENV, &GPIOS, &ADCS, &SERIAL_PORTS, &RTCS, &NVM_STORAGE, &FIRMWARE_MAIN_LOADER, &FIRMWARE_BOOT_LOADER); -// GpioPinSet(&MAIN_ENV.gpios->Power.tx_pwr_5, true); -// GpioPinSet(&MAIN_ENV.gpios->Power.tx_pwr_en, true); -// delay_ms(200); -// nvic_priority_group_config(NVIC_PRIORITY_GROUP_4); -// sendI2c(); - -// FS_Init(&MAIN_ENV.fs); Mma_InitFs(&MAIN_ENV); - DeviceStorageIni_Init(&MAIN_ENV.storageIni, file_setup, file_counter, &MAIN_ENV.fs, settings, SettingSizeTbl); -// DeviceStorage_Init(&MAIN_ENV.storage, &MAIN_ENV.flash->interface); - EthDataQueue = osMessageQueueNew(256, 4, NULL); adc_ordinary_software_trigger_enable(MAIN_ENV.adcs->vcc.ADCx, TRUE); @@ -175,7 +151,6 @@ int main(void) { error_status status = emac_system_init_eth(); -// while (status == ERROR); tcpip_stack_init(data); Mma_StartThread(&MAIN_ENV); @@ -183,5 +158,11 @@ int main(void) { osKernelStart(); while (1) { + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); } } \ No newline at end of file diff --git a/artery_f437.cfg b/artery_f437.cfg index fd57c89..c0ae719 100644 --- a/artery_f437.cfg +++ b/artery_f437.cfg @@ -3,15 +3,11 @@ # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF259090 # -source [find interface/stlink.cfg] +source [find interface/atlink.cfg] -transport select hla_swd +#transport select hla_swd -adapter list - -#adapter serial 36006000080000315151524E - -source [find target/at32f435xM.cfg] +source [find target/at32f437xM.cfg] #reset_config trst_only #reset_config srst_only @@ -21,9 +17,6 @@ source [find target/at32f435xM.cfg] #reset_config srst_gates_jtag #reset_config trst_push_pull #reset_config trst_push_pull -adapter srst delay 100 - -adapter speed 2000 reset_config none diff --git a/modular.json b/modular.json index 519a01b..25dcae1 100644 --- a/modular.json +++ b/modular.json @@ -253,41 +253,6 @@ }, - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "SpiPortInterface" - }, - - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "SpiPort" - }, - - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "SpiPort_ARTERY_AT32" - }, - - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "GONEC_ARTERY_SpiPorts" - }, - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "Flash_EN25QH128A_104HIP" - }, - - { - "type": "git", - "provider": "GONEC_NEW", - "repo": "Flash_MT29F2G01ABAGDWB" - }, - { "type": "git", "provider": "GONEC_NEW",