Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bsp][nuvoton][rsoc] Fix compilation issues with bsp of nuvoton series #9481

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/bsp_buildings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ jobs:
- "renesas/rzn2l_rsk"
- "frdm-k64f"
- "xplorer4330/M4"
- RTT_BSP: "nuvoton"
RTT_TOOL_CHAIN: "sourcery-arm"
SUB_RTT_BSP:
- "nuvoton/numaker-pfm-m487"
- "nuvoton/numaker-hmi-ma35d1"
- "nuvoton/numaker-iot-m487"
- "nuvoton/numaker-m032ki"
- "nuvoton/numaker-iot-m467"
- "nuvoton/numaker-m467hj"
- "nuvoton/nk-n9h30"
- "nuvoton/nk-rtu980"
- "nuvoton/ma35-rtp"
- "nuvoton/nk-980iot"
- "nuvoton/numaker-iot-ma35d1"
- "nuvoton/numaker-m2354"
- RTT_BSP: "gd32_n32_apm32"
RTT_TOOL_CHAIN: "sourcery-arm"
SUB_RTT_BSP:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/manual_trigger_scons_except_STM32_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,19 @@ jobs:
# - {RTT_BSP_NAME: "yichip_yc3121-pos", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "yichip/yc3121-pos"} #编译问题
# - {RTT_BSP_NAME: "yichip_yc3122-pos", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "yichip/yc3122-pos"} #编译问题
- {RTT_BSP_NAME: "zynqmp-r5-axu4ev", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "zynqmp-r5-axu4ev"}

- {RTT_BSP_NAME: "nuvoton_numaker-pfm-m487", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-pfm-m487"}
- {RTT_BSP_NAME: "nuvoton_numaker-hmi-ma35d1", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-hmi-ma35d1"}
- {RTT_BSP_NAME: "nuvoton_numaker-iot-m487", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-iot-m487"}
- {RTT_BSP_NAME: "nuvoton_numaker-m032ki", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-m032ki"}
- {RTT_BSP_NAME: "nuvoton_numaker-iot-m467", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-iot-m467"}
- {RTT_BSP_NAME: "nuvoton_numaker-m467hj", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-m467hj"}
- {RTT_BSP_NAME: "nuvoton_nk-n9h30", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/nk-n9h30"}
- {RTT_BSP_NAME: "nuvoton_nk-rtu980", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/nk-rtu980"}
- {RTT_BSP_NAME: "nuvoton_ma35-rtp", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/ma35-rtp"}
- {RTT_BSP_NAME: "nuvoton_nk-980iot", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/nk-980iot"}
- {RTT_BSP_NAME: "nuvoton_numaker-iot-ma35d1", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-iot-ma35d1"}
- {RTT_BSP_NAME: "nuvoton_numaker-m2354 ", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "nuvoton/numaker-m2354"}

steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down
14 changes: 7 additions & 7 deletions bsp/nuvoton/libraries/m031/rtt_port/drv_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct nu_adc
typedef struct nu_adc *nu_adc_t;

/* Private functions ------------------------------------------------------------*/
static rt_err_t nu_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled);
static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value);
static rt_err_t nu_adc_enabled(struct rt_adc_device *device, rt_int8_t channel, rt_bool_t enabled);
static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_int8_t channel, rt_uint32_t *value);

/* Public functions ------------------------------------------------------------*/
int rt_hw_adc_init(void);
Expand Down Expand Up @@ -60,7 +60,7 @@ typedef struct rt_adc_ops *rt_adc_ops_t;


/* nu_adc_enabled - Enable ADC clock and wait for ready */
static rt_err_t nu_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled)
static rt_err_t nu_adc_enabled(struct rt_adc_device *device, rt_int8_t channel, rt_bool_t enabled)
{

ADC_T *adc_base = ((nu_adc_t)device)->adc_base;
Expand Down Expand Up @@ -96,7 +96,7 @@ static rt_err_t nu_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel
return RT_EOK;
}

static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value)
static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_int8_t channel, rt_uint32_t *value)
{

RT_ASSERT(device != RT_NULL);
Expand All @@ -111,7 +111,7 @@ static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_uint32_t chann
return -(RT_EINVAL);
}

if ((*padc_reg_tab & (1 << channel)) == 0)
if ((*padc_reg_tab & (0x1 << channel)) == 0)
{
*value = 0xFFFFFFFF;
return -(RT_EBUSY);
Expand All @@ -127,7 +127,7 @@ static rt_err_t nu_get_adc_value(struct rt_adc_device *device, rt_uint32_t chann

while (ADC_GET_INT_FLAG(adc_base, ADC_ADF_INT) == 0);

*value = ADC_GET_CONVERSION_DATA(adc_base, channel);
*value = ADC_GET_CONVERSION_DATA(adc_base,channel);

return RT_EOK;
}
Expand All @@ -151,4 +151,4 @@ int rt_hw_adc_init(void)
INIT_BOARD_EXPORT(rt_hw_adc_init);


#endif //#if defined(BSP_USING_ADC)
#endif /* #if defined(BSP_USING_ADC) */
11 changes: 3 additions & 8 deletions bsp/nuvoton/libraries/m031/rtt_port/drv_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ void SysTick_Handler(void)
rt_interrupt_leave();
}

void rt_hw_cpu_reset(void)
{
SYS_UnlockReg();

SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk;
}

#ifdef RT_USING_CPU_FFS
int __rt_ffs(int value)
{
Expand All @@ -136,7 +129,9 @@ int __rt_ffs(int value)
#include <finsh.h>
static void reboot(uint8_t argc, char **argv)
{
rt_hw_cpu_reset();
SYS_UnlockReg();

SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk;
}
MSH_CMD_EXPORT(reboot, Reboot System);
#endif /* RT_USING_FINSH */
8 changes: 4 additions & 4 deletions bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ static void soft_time_setup(uint32_t wanted_sec, uint32_t hz, soft_time_handle_t
static void soft_time_feed_dog(soft_time_handle_t *const soft_time);

#if defined(RT_USING_PM)
static int wdt_pm_suspend(const struct rt_device *device, rt_uint8_t mode);
static rt_err_t wdt_pm_suspend(const struct rt_device *device, rt_uint8_t mode);
static void wdt_pm_resume(const struct rt_device *device, rt_uint8_t mode);
static int wdt_pm_frequency_change(const struct rt_device *device, rt_uint8_t mode);
static rt_err_t wdt_pm_frequency_change(const struct rt_device *device, rt_uint8_t mode);
static void soft_time_freqeucy_change(uint32_t new_hz, soft_time_handle_t *const soft_time);
#endif

Expand Down Expand Up @@ -132,7 +132,7 @@ static struct rt_device_pm_ops device_pm_ops =
#if defined(RT_USING_PM)

/* device pm suspend() entry. */
static int wdt_pm_suspend(const struct rt_device *device, rt_uint8_t mode)
static rt_err_t wdt_pm_suspend(const struct rt_device *device, rt_uint8_t mode)
{
switch (mode)
{
Expand Down Expand Up @@ -184,7 +184,7 @@ static void wdt_pm_resume(const struct rt_device *device, rt_uint8_t mode)


/* device pm frequency_change() entry. */
static int wdt_pm_frequency_change(const struct rt_device *device, rt_uint8_t mode)
static rt_err_t wdt_pm_frequency_change(const struct rt_device *device, rt_uint8_t mode)
{
uint32_t clk, new_hz;

Expand Down
Loading
Loading