Skip to content

Commit

Permalink
[bsp][airm2m/air105][rsoc] Fix compilation issues with bsp of airm2m/…
Browse files Browse the repository at this point in the history
…air105
  • Loading branch information
hydevcode authored Sep 30, 2024
1 parent 1bf3d79 commit 443d56c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bsp_buildings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
- "rm48x50"
- "ht32/ht32f52352"
- "ht32/ht32f12366"
- "airm2m/air105"
- "w60x"
- "essemi/es32f0654"
- "essemi/es32f365x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
legs:
- {RTT_BSP_NAME: "acm32_acm32f0x0-nucleo", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "acm32/acm32f0x0-nucleo"}
- {RTT_BSP_NAME: "acm32_acm32f4xx-nucleo", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "acm32/acm32f4xx-nucleo"}
#- {RTT_BSP_NAME: "airm2m_air105", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "airm2m/air105"} #scons fail in last step
- {RTT_BSP_NAME: "airm2m_air105", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "airm2m/air105"}
- {RTT_BSP_NAME: "airm2m_air32f103", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "airm2m/air32f103"}
#- {RTT_BSP_NAME: "allwinner_d1", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "allwinner/d1"} # rt-smart fail toolchain
#- {RTT_BSP_NAME: "allwinner_d1s", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "allwinner/d1s"} #toochain
Expand Down
11 changes: 7 additions & 4 deletions bsp/airm2m/air105/board/board.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-02-22 airm2m first version
*/

#include "board.h"
#include "drv_common.h"
#include "drv_gpio.h"
#include "drv_usart_v2.h"

uint32_t SystemCoreClock;
extern const uint32_t __isr_start_address;

Expand Down Expand Up @@ -38,7 +41,7 @@ void SystemInit(void)
__enable_irq();
}

void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
{
SystemCoreClock = HSE_VALUE * (((SYSCTRL->FREQ_SEL & SYSCTRL_FREQ_SEL_XTAL_Mask) >> SYSCTRL_FREQ_SEL_XTAL_Pos) + 1);
}
Expand All @@ -56,7 +59,7 @@ void rt_hw_board_init(void)
rt_hw_systick_init();
DMA_GlobalInit();
Uart_GlobalInit();
DMA_TakeStream(DMA1_STREAM_1);//for qspi
DMA_TakeStream(DMA1_STREAM_1);/* for qspi */
CoreTick_Init();
#ifdef RT_USING_PIN
rt_hw_pin_init();
Expand Down
4 changes: 2 additions & 2 deletions bsp/airm2m/air105/libraries/HAL_Driver/Inc/core_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

#ifndef __CORE_IRQ_H__
#define __CORE_IRQ_H__

#include <stdint.h>
/**
* @brief 设置中断回调函数
*
* @param Irq 中断号 0~IRQ_LINE_MAX
* @param Handler 中断回调函数,如 void Irq_Handler(uint32_t IrqLine, void *pData); 可以多个中断号对应1个中断函数,回调时传入中断号和用户数据
*/
void ISR_SetHandler(int32_t Irq, void *Handler);
void ISR_SetHandler(int32_t Irq, void *Handler, void *pData);
/**
* @brief 设置中断优先级
*
Expand Down
16 changes: 8 additions & 8 deletions bsp/airm2m/air105/libraries/HAL_Driver/Src/core_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include "core_irq.h"
#include "user.h"
typedef struct
{
const DMA_TypeDef *RegBase;
DMA_TypeDef *RegBase;
const uint32_t Index;
CBFuncEx_t CB;
void *pData;
Expand Down Expand Up @@ -65,17 +65,17 @@ typedef struct

/************ operation definition for DMA DMA_CFG_L REGISTER ************/
#define DMA_CFG_HS_SEL_SRC_Pos (11)
#define DMA_CFG_HS_SEL_SRC_Mask (0x01U<<DMA_CFG_HS_SEL_SRC_Pos)//0 HARD 1 SOFT
#define DMA_CFG_HS_SEL_SRC_Mask (0x01U<<DMA_CFG_HS_SEL_SRC_Pos)/*0 HARD 1 SOFT*/

#define DMA_CFG_HS_SEL_DST_Pos (10)
#define DMA_CFG_HS_SEL_DST_Mask (0x01U<<DMA_CFG_HS_SEL_DST_Pos)

/************ operation definition for DMA DMA_CFG_H REGISTER ************/
#define DMA_CFG_DEST_PER_Pos (11)
#define DMA_CFG_DEST_PER_Mask (0x07U<<DMA_CFG_DEST_PER_Pos)//need write current channel num
#define DMA_CFG_DEST_PER_Mask (0x07U<<DMA_CFG_DEST_PER_Pos)/*need write current channel num*/

#define DMA_CFG_SRC_PER_Pos (7)
#define DMA_CFG_SRC_PER_Mask (0x07U<<DMA_CFG_SRC_PER_Pos)//need write current channel num
#define DMA_CFG_SRC_PER_Mask (0x07U<<DMA_CFG_SRC_PER_Pos)/*need write current channel num*/

/************ operation definition for DMA DMA_LLP_L REGISTER ************/
#define DMAC_LLP_NEXT_LLI_MSK (0x3)
Expand Down Expand Up @@ -212,7 +212,7 @@ int DMA_ConfigStream(uint8_t Stream, void *Config)
(DMA_InitStruct->DMA_PeripheralDataSize << DMA_CTL_DST_TR_WIDTH_Pos);

hwDMAChannal[Stream].TxDir = 1;
// hwDMA->CFG_L = (1 << 18);
/* hwDMA->CFG_L = (1 << 18); */
hwDMA->CFG_L = 0;
break;
default:
Expand Down Expand Up @@ -333,7 +333,7 @@ uint32_t DMA_GetDataLength(uint8_t Stream, uint32_t FirstAddress)
static void DMA_IrqHandle(int32_t IrqLine, void *pData)
{
uint32_t i;
// DBG("%x", DMA->StatusTfr_L);
/* DBG("%x", DMA->StatusTfr_L); */
if (DMA->StatusInt_L & (1 << 0))
{
for(i = 0; i < DMA_STREAM_QTY; i++)
Expand All @@ -352,7 +352,7 @@ static void DMA_IrqHandle(int32_t IrqLine, void *pData)
if (DMA->StatusErr_L & (1 << i))
{
DMA->ClearErr_L = (1 << i);
hwDMAChannal[i].CB(hwDMAChannal[i].pData, 0xffffffff);
hwDMAChannal[i].CB(hwDMAChannal[i].pData, (void *)0xffffffff);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions bsp/airm2m/air105/libraries/rt_drivers/drv_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ void _Error_Handler(char *s, int num);

#define DMA_NOT_AVAILABLE ((DMA_INSTANCE_TYPE *)0xFFFFFFFFU)

/**
* This function is mainly used for SysTick initialization
*
*/
void rt_hw_systick_init(void);

#ifdef __cplusplus
}
#endif
Expand Down
9 changes: 4 additions & 5 deletions bsp/airm2m/air105/makesoc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

import os
import sys
import shutil
import urllib

import urllib.request
out_path='./'
bin_file_name='rtthread.bin'
pack_path='./pack'
Expand All @@ -17,13 +15,14 @@
os.remove(out_file+'.soc')

if not os.path.exists(pack_path+'/bootloader.bin'):
urllib.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/bootloader.bin", pack_path+'/bootloader.bin')
urllib.request.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/bootloader.bin", pack_path + '/bootloader.bin')

if not os.path.exists(pack_path+'/soc_download.exe'):
urllib.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/soc_download.exe", pack_path+'/soc_download.exe')
urllib.request.urlretrieve("http://cdndownload.openluat.com/rt-thread/airm2m/air105/bootloader.bin", pack_path + '/bootloader.bin')

shutil.copy(out_path+bin_file_name, pack_path+'/'+bin_file_name)
shutil.make_archive(out_file, 'zip', root_dir=pack_path)
os.remove(pack_path+'/'+bin_file_name)
os.rename(out_file+'.zip',out_file+'.soc')

print('end')

0 comments on commit 443d56c

Please sign in to comment.