hpmicro / hpm_sdk Goto Github PK
View Code? Open in Web Editor NEWNo PR will be accepted for now, but feel free to submit issue, very appreciated.
Home Page: https://hpm-sdk.readthedocs.io/
License: BSD 3-Clause "New" or "Revised" License
No PR will be accepted for now, but feel free to submit issue, very appreciated.
Home Page: https://hpm-sdk.readthedocs.io/
License: BSD 3-Clause "New" or "Revised" License
测试 rom sm4 api 速度发现与软件计算的速度相差很小,芯片带的 sm4 只是内置一个软件函数,没有任何硬件加速吗?
in hpm_pwm_drv.h line 696: the function "void pwm_get_captured_count(..."
in hpm_pwm_drv.c line 24: the function "void pwm_get_count(..."
I think they reffer to the same function, should be typing error, please check it
当函数为可变参形式时,比如
int func(char* buff, unsigned buffsize, const char* format, ...);
当可变参中有64位参数时,或者使用ilp32d的浮点参数时,调用这个函数会生成错误的calling convention。
例如:
int64_t v64 = 0x123456789ABCDEF0;
func(buff, sizeof(buff), "%lld", v64);
会为常量字符串生成32位地址加载指令对儿,
lui a2, 0x?????(HIGH20)
addi a2, a2, 0x???(LOW12)
当可变参数量稍微多几个时,出现分配寄存器错误,如
func(buff, sizeof(buff), "%d %lld %u", v32, v64, v32);
lui a5, 0x?????(HIGH20)
addi a2, a5, 0x???(LOW12) // a2 is the const char* format, global address in .rodata section
占用了 a5,而调用规约里的 a5 用于后面的可变参数,导致函数体内解析不到 a5 承载的参数。
此问题在 sdk1.4.0 附带工具链(gcc-11.1-2022.04.12-riscv32-unknown-elf)中发现,
经测试,sdk1.5.0 附带工具链中依然存在
$ cmake --version
cmake version 3.25.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
if(NOT DEFINED $ENV{HPM_SDK_BASE})
message(FATAL_ERROR "HPM_SDK_BASE is not set yet")
endif()
经过测试,删除'$ENV'的'$'即可通过,不知是CMake的什么特性
vector.h文件25行,在使用RTOS,且中断使用向量模式时,中断向量表0位置应该放置RTOS的trap_handler 而不应该再放置irq_handler_trap,所以为了兼容是否使用RTOS、是否使用中断向量模式,是否应该修改为 " .set default_isr_trap, HANDLER_TRAP"
compare exist openocd hpm_xpi algorithm small size. the openocd_algo example compile out about 41KB size. included C lib support APIs. the $(HPM_SDK)/drivers/*.c some vars.
HPM SDK version is 1.1.0.
How to remove these unused symbols? reduce the code size. the "-ffunction-sections", "-fdata-sections" seem already used. but "--gc-sections" seem the rv32imac-ilp32-multilib-win toolchain did not supported.
看了一下sample目录里面没有adc的例子。
在sdk_env_v0.12.1中没有看到Linux环境下的编译器。
请问Linux环境下的gcc编译器需要在哪里下载?
如题,BOARD_BLDC_ADC_CH_W通道号正确值应为4,代码中为6,导致ADC读不出值
sdk versiong:hpm_sdk v1.1.0
file name: drivers/inc/hpm_pla_drv.h
typedef union pla_filter_cfg {
struct {
uint32_t sync_edge_filter_disable:1;
uint32_t software_inject:2;
uint32_t filter_reverse:1;
uint32_t edge_dect_en:1;
uint32_t nege_edge_dect_en:1;
uint32_t pose_edge_dect_en:1;
uint32_t filter_sync_level:1;
uint32_t filter_ext_en:1;
uint32_t reserved:3;
uint32_t filter_ext_type:3;
uint32_t filter_ext_counter:16;
};
uint32_t val;
} pla_filter_cfg_t;
This struct should have 32bit, but only 31bit here. There should be 1 reserved bit between filter_ext_type
and filter_ext_counter
according to UM. Please check.
I'm trying to get a Hello World
sample project running for my HPM6200EVK_RevB
board. Unfortunately, I got stuck.
I followed all the installation steps pointed out on https://github.com/hpmicro/hpm_sdk
The only step I could not understand completely, is this one:
Grab a copy of toolchain zip package and unzip to certain path, take
TOOLCHAIN_PATH
for example, (riscv32-unknown-elf-gcc
is supposed to be found inTOOLCHAIN_PATH/bin
)
This step does not explain where to grab a copy of the toolchain. I have no idea where that toolchain is. Perhaps this one:
https://github.com/hpmicro/riscv-gnu-toolchain/releases/tag/2022.05.15
But it has no build for Windows. Where can I find a Windows toolchain for HPMicro?
如题,无论是使用hrpmw例程基础上添加故障保护还是自己写的程序都一样
使用hrpwm例程在generate_edge_aligned_waveform内做如下改动:
修改定义适配硬件
// hrpwm.c:17
#define HRPWM HPM_PWM0
#define PWM_CLOCK_NAME clock_mot0
#define PWM_OUTPUT_PIN1 0
#define PWM_OUTPUT_PIN2 1
#define TRGM HPM_TRGM0
// pinmux.c
void init_hrpwm_pins(PWM_Type *ptr)
{
if (ptr == HPM_PWM0) {
HPM_IOC->PAD[IOC_PAD_PB12].FUNC_CTL = IOC_PB12_FUNC_CTL_PWM0_P_0;
HPM_IOC->PAD[IOC_PAD_PB13].FUNC_CTL = IOC_PB13_FUNC_CTL_PWM0_P_1;
HPM_IOC->PAD[IOC_PAD_PB14].FUNC_CTL = IOC_PB14_FUNC_CTL_PWM0_P_2;
HPM_IOC->PAD[IOC_PAD_PB15].FUNC_CTL = IOC_PB15_FUNC_CTL_PWM0_P_3;
HPM_IOC->PAD[IOC_PAD_PB16].FUNC_CTL = IOC_PB16_FUNC_CTL_PWM0_P_4;
HPM_IOC->PAD[IOC_PAD_PB17].FUNC_CTL = IOC_PB17_FUNC_CTL_PWM0_P_5;
}
}
配置故障电平及恢复方式的代码
pwm_config.fault_mode = pwm_fault_mode_force_output_0;
pwm_config.fault_recovery_trigger = pwm_fault_recovery_on_reload;
配置故障保护的代码,添加在pwm_setup_waveform之后
/* 开启debug故障保护模式 */
pwm_fault_source_config_t fault_config = {};
fault_config.source_mask = PWM_GCR_DEBUGFAULT_SET(1);
pwm_config_fault_source(HRPWM, &fault_config);
函数末尾for循环内写一个死循环将程序卡住方便操作
现象:
进入调试后启动程序生成波形,点击暂停运行触发故障保护波形消失,继续运行波形不能恢复
若注释pwm_enable_hrpwm(HRPWM);
不启用hrpwm功能则能正常恢复
手册里面是这么描述的:拨码开关的第 3 位是用来选择对应 IO 是当千兆网接口或电机接口。当拨到 ON 档,对应引脚是选择板上 PWM输出,当拨到 OFF 档,对应引脚是选择板上千兆网接口。
而在开发板正对SW1的丝印层上,左上角是“1”,左下角是“RGMII”,与手册描述相反。
无人机飞行控制系统,特别需要高性能的MCU。而例如开源的PX4飞控,主要基于Nuttx RTOS,现在STM32H7和NXP RT1060都支持了,希望也能支持Hpmicro的芯片,多一个国产选择。
如题,在HPM5361环境中DMA缓冲区长度不对会产生DMA越界
5361v03手册54.2.8中的描述是抢占模式的DMA会占用一块192字节的缓冲区,实际分配为160字节
手册中对DMA如何写入内存的方式描述不清楚,是特定触发写入特定区域内存还是192字节全部都会写入
https://github.com/hpmicro/hpm_sdk/blob/b612c6fda97a8d16de16b80bf06fa54f15043496/samples/motor_ctrl/bldc_foc/src/bldc_foc.c#L40C6-L40C6
Hi :
i did not want program generate 16bit compress instruction, change the ARCH to the "rv32ima". use gcc toolchain.
But found the SDK_DECLARE_EXT_ISR_M use Assembler 16 bit instruction doing optimization in board.c.
why did not add Assembler 32 bit instruction optimization?
SDK version: 1.2.0
Board: hpm6750evkmini.
toolchain: rv32imac-ilp32-multilib-win
在cam目录下执行以下命令
hpm_sdk\samples\drivers\cam>generate_project -b hpm6750evk
segger es编译输出如下:
Building ‘cam_example’ from solution ‘cam_example’ in configuration ‘Debug’
Compiling ‘cam.c’
Compiling ‘hpm_uart_drv.c’
Compiling ‘hpm_dram_drv.c’
Compiling ‘hpm_sdp_drv.c’
Compiling ‘hpm_lcdc_drv.c’
Compiling ‘hpm_i2c_drv.c’
Compiling ‘hpm_pmp_drv.c’
Compiling ‘hpm_rng_drv.c’
Compiling ‘hpm_gpio_drv.c’
Compiling ‘hpm_spi_drv.c’
Compiling ‘hpm_pdma_drv.c’
Compiling ‘hpm_wdg_drv.c’
Compiling ‘hpm_dma_drv.c’
Compiling ‘hpm_gptmr_drv.c’
Compiling ‘hpm_pwm_drv.c’
Compiling ‘hpm_pllctl_drv.c’
Compiling ‘hpm_usb_drv.c’
Compiling ‘hpm_rtc_drv.c’
Compiling ‘hpm_acmp_drv.c’
Compiling ‘hpm_i2s_drv.c’
Compiling ‘hpm_dao_drv.c’
Compiling ‘hpm_pdm_drv.c’
Compiling ‘hpm_vad_drv.c’
Compiling ‘hpm_cam_drv.c’
Compiling ‘hpm_can_drv.c’
Compiling ‘hpm_jpeg_drv.c’
Compiling ‘hpm_enet_drv.c’
Compiling ‘hpm_sdxc_drv.c’
Compiling ‘hpm_adc12_drv.c’
Compiling ‘hpm_adc16_drv.c’
Compiling ‘hpm_pmu_drv.c’
Compiling ‘hpm_ptpc_drv.c’
Compiling ‘hpm_mchtmr_drv.c’
Compiling ‘hpm_debug_console.c’
Compiling ‘hpm_ov7725.c’
Compiling ‘hpm_camera_ov7725.c’
Compiling ‘pinmux.c’
Compiling ‘board.c’
Compiling ‘hpm_swap.c’
Compiling ‘hpm_ffssi.c’
Compiling ‘reset.c’
Compiling ‘trap.c’
Assembling ‘startup.s’
Compiling ‘system.c’
Compiling ‘hpm_sysctl_drv.c’
Compiling ‘hpm_l1c_drv.c’
Compiling ‘hpm_clock_drv.c’
Compiling ‘hpm_otp_drv.c’
Linking cam_example.elf
multiply defined global symbol _flash_size
defined by [ Linker created ]
and by [ Linker created ]
multiply defined global symbol _extram_size
defined by [ Linker created ]
and by [ Linker created ]
multiply defined global symbol _flash_size
defined by [ Linker created ]
and by [ Linker created ]
multiply defined global symbol _extram_size
defined by [ Linker created ]
and by [ Linker created ]
Build failed
nuttx功能比较强大,有Linux特性,又是实时系统且占用资源少;hpm sdk何时适配nuttx系统?https://github.com/apache/nuttx
Lots of IOT application requires ssl/tls connection.
如题,ADC初始化时没有相应的库函数进行中断使能标志置位导致无法进入中断
参考v0.3手册54.4.19 INT_EN寄存器功能
并不存在 hpm5361.cfg,应该替换为 hpm5300.cfg?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.