前几天弄环境弄了几天,最后终于解决了,还把问题点弄清楚了,今天先来点灯,可以为后续准备。
开发平台:Visual Studio Code
下载器:JLINK
开发板:AGM TCK AG32VF407VGT6
目地:点亮LED灯,并闪烁。
下面开始点灯:
1、原理图:
G32VF407和STM32F407的GPIO不完全相同,AG32VF407使用PIN_XX的格式来定义每个引脚,其中XX与原理图芯片对应引脚的编号一致,与STM32对比,举例来说,PA6对应PIN_31,PA7对应PIN_32。
这意味着在AG32VF407的SDK中,你需要使用PIN_31来控制PA6引脚,使用PIN_32来控制PA7引脚。需要注意的是,虽然AG32VF与STM32F407具有相似的脚功能,但是他们的引脚命名并完全一致,因此在使用AG32VF407时需要根据具体的引脚编号进行设置。
2、在Visual Studio Code使用并下载代码在开发板中,具体方法如下:
注意图片中的相关菜单,不能弄出,还有编辑框的相关代码,一定要一一对应。
上传烧录VE:
上传VE成功后,就可以点左下角的勾进行下载在开发板中.
3.相关代码:
[setup]
boards_dir = boards
board = agrv2k_407
board_logic.ve = example_board.ve
framework = agrv_sdk
program = agm_example
src_dir = src
include_dir = src
src_filter = "-<*> +<*.c>"
lwip_imp_dir =
tinyusb_imp_dir =
logger_if = UART0
upload_port = COM3
monitor_port = COM3
monitor_speed = 115200
debug_speed = 10000
debug_tool = jlink-openocd
upload_protocol = jlink-openocd
[setup_rtt]
logger_if = RTT
monitor_port = socket://localhost:19021
[platformio]
boards_dir = ${setup.boards_dir}
src_dir = ${setup.src_dir}
include_dir = ${setup.include_dir}
default_envs = dev
[env]
platform = AgRV
extends = setup
[env:dev]
build_type = debug
[env:release]
build_type = release
[env:rtt]
build_type = debug
extends = setup_rtt
[env:serial]
build_type = release
upload_protocol = serial
upload_speed = 115200
custom_speed = 115200
#define LED_D3_GPIO GPIO4
#define LED_D3_GPIO_BITS (1 << 3)
SYS_EnableAPBClock(APB_MASK_GPIO4);
GPIO_SetOutput(LED_D3_GPIO, LED_D3_GPIO_BITS);
GPIO_SetHigh(LED_D3_GPIO, LED_D3_GPIO_BITS);
int counter = 0;
while (1) {
UTIL_IdleMs(10);
GPIO_Toggle(LED_D3_GPIO, LED_D3_GPIO_BITS);
printf("test %d \r\n", counter++);
}
TestGpio();
4、显示闪烁视频
91eca5374f0cf8163f0b9dd58ac39f06
|