Changes from v2.7.7 to v2.7.8:
[feat]:upgrade patch tool to v3.8 [opt]:opt code generate process display [opt]:opt login logic [opt]:opt ghs support [opt]:add MC03 ghs support根据EFM应用手册, 代码如下:
e5d06a67-707a-4437-9453-a1f2d6c6c344-image.png
实际得出的MAC值与第三方不一致:
854f3bc4-6c9c-4006-98f5-90f5794c4e8a-301990fa21c0cbedaf55036d58c482fa.png 0eed32cf-46d9-4d5f-8ffd-12583f05f3d3-image.png
是不是load的硬件key不对?
CUS_KEY寄存器中的match==1
e3850e1e-ba9d-4c02-99af-43bbf38c2d9c-image.png
40a655bc-2833-417d-b6a0-ed78d856f1f0-image.png
更换字节顺序也无效
demo工程如下
Flash_Demo.zip
调用的写入擦除函数分别是FLASH_DRV_Program FLASH_DRV_EraseSector
最近在使用YTM32B1ME05的ADC模块时时遇到了一个问题,使用了ADC0和ADC1两个模块,固定通过eTMR的一个通道触发采集,周期大概在1ms,测试发现采集到的AD值会一直跳动,排查发现和切换TMU和ADC_CHSELx的配置有关系,请问下这里有什么需要注意和的地方吗?如何解决?
原理图 VREF:5d40928c-e247-4a91-b65f-c6f25f61dab7-image.png
不切换配置 void user_adc_start_conversion(void) { tmu_target_module_t targetModule = TMU_TARGET_MODULE_ADC0_EXT_TRIG; /* Configure ADC channel selection based on PWM index */ if(adcInst[UserAdcParams.pwmIndex][0] == ADC1_INST) { // ADC1->CHSEL[0] = adcInst[UserAdcParams.pwmIndex][1]; // ADC1->CHSEL[1] = adcInst[UserAdcParams.pwmIndex][1]; // ADC1->CHSEL[2] = adcInst[UserAdcParams.pwmIndex][1]; // ADC1->CHSEL[3] = adcInst[UserAdcParams.pwmIndex][1]; // targetModule = TMU_TARGET_MODULE_ADC1_EXT_TRIG; } else { // ADC0->CHSEL[0] = adcInst[UserAdcParams.pwmIndex][1]; // ADC0->CHSEL[1] = adcInst[UserAdcParams.pwmIndex][1]; // ADC0->CHSEL[2] = adcInst[UserAdcParams.pwmIndex][1]; // ADC0->CHSEL[3] = adcInst[UserAdcParams.pwmIndex][1]; // targetModule = TMU_TARGET_MODULE_ADC0_EXT_TRIG; } /* Update TMU target module directly without reinitializing entire TMU * This is more efficient than TMU_DRV_Init which resets all target modules */ TMU->MUX[3] = 0; TMU->MUX[4] = 0; TMU_SetTrigSourceForTargetModule(TMU, TMU_TRIG_SOURCE_eTMR0_EXT_TRIG, targetModule); }结果如图,基本在2938~2948之内,波动比较小
12ce6b9a-cd59-44af-be94-d96c91fa69c4-image.png
结果如图
ca3aea5b-fc44-4907-95d7-69118442a9b3-image.png
注意通道0和1不切换,只切换2和3
void user_adc_start_conversion(void) { tmu_target_module_t targetModule = TMU_TARGET_MODULE_ADC1_EXT_TRIG; /* Configure ADC channel selection based on PWM index */ if(adcInst[UserAdcParams.pwmIndex][0] == ADC1_INST) { // ADC1->CHSEL[0] = adcInst[UserAdcParams.pwmIndex][1]; // ADC1->CHSEL[1] = adcInst[UserAdcParams.pwmIndex][1]; ADC1->CHSEL[2] = adcInst[UserAdcParams.pwmIndex][1]; ADC1->CHSEL[3] = adcInst[UserAdcParams.pwmIndex][1]; targetModule = TMU_TARGET_MODULE_ADC1_EXT_TRIG; } else { // ADC0->CHSEL[0] = adcInst[UserAdcParams.pwmIndex][1]; // ADC0->CHSEL[1] = adcInst[UserAdcParams.pwmIndex][1]; ADC0->CHSEL[2] = adcInst[UserAdcParams.pwmIndex][1]; ADC0->CHSEL[3] = adcInst[UserAdcParams.pwmIndex][1]; targetModule = TMU_TARGET_MODULE_ADC0_EXT_TRIG; } /* Update TMU target module directly without reinitializing entire TMU * This is more efficient than TMU_DRV_Init which resets all target modules */ TMU->MUX[3] = 0; TMU->MUX[4] = 0; TMU_SetTrigSourceForTargetModule(TMU, TMU_TRIG_SOURCE_eTMR0_EXT_TRIG, targetModule); }结果如图,抖动的比较厉害
e9dba9d3-df63-48a0-af25-c6f373d1a629-image.png
用到的函数
/** * @brief Print latest ADC samples in JustFloat-like format */ void user_adc_print_samples(void) { uint8_t frame[4U * sizeof(float) + 4U]; uint32_t offset = 0U; if(!sendFlag) { return; } sendFlag = false; for(uint8_t idx = 0U; idx < 4U; idx++) { float f = (float)adcSapleResult[idx]; (void)memcpy(&frame[offset], &f, sizeof(float)); offset += (uint32_t)sizeof(float); } (void)memcpy(&frame[offset], c_justfloat_tail, sizeof(c_justfloat_tail)); offset += (uint32_t)sizeof(c_justfloat_tail); /* Send with LINFlexD UART polling, instance = 2 */ LINFlexD_UART_DRV_SendDataPolling(2U, frame, offset); } /** * @brief ADC0 interrupt handler * @return none */ void ADC0_IRQHandler(void) { ADC_DRV_ClearEoseqFlagCmd(0); adcSapleResult[0] = ADC_DRV_ReadFIFO(0); adcSapleResult[1] = ADC_DRV_ReadFIFO(0); adcSapleResult[2] = ADC_DRV_ReadFIFO(0); adcSapleResult[3] = ADC_DRV_ReadFIFO(0); adcSapleSum = adcSapleResult[0] + adcSapleResult[1] + adcSapleResult[2] + adcSapleResult[3]; updateAdcResult(adcSapleSum >> 2); UserAdcParams.boardSupplyVolt.rawAdcValue = ADC_DRV_ReadFIFO(0); UserAdcParams.ledSupplyVolt.rawAdcValue = ADC_DRV_ReadFIFO(0); } /** * @brief ADC1 interrupt handler * @return none */ void ADC1_IRQHandler(void) { ADC_DRV_ClearEoseqFlagCmd(1); adcSapleResult[0] = ADC_DRV_ReadFIFO(1); adcSapleResult[1] = ADC_DRV_ReadFIFO(1); adcSapleResult[2] = ADC_DRV_ReadFIFO(1); adcSapleResult[3] = ADC_DRV_ReadFIFO(1); adcSapleSum = adcSapleResult[0] + adcSapleResult[1] + adcSapleResult[2] + adcSapleResult[3]; updateAdcResult(adcSapleSum >> 2); sendFlag = true; }在应用ME05 CUS_NVR时,如果直接调用“FLASH_DRV_Program”会无法操作,因为ME05的NVR有单独的驱动:“FLASH_DRV_ProgramNVR”等;(而HA01系列则是同一套flash驱动,需要区分应用)
下述具体测试情况
环境
软件:YCT_SDK1.3.1 Flash_Disable_Jtag_Demo 硬件:ME05 EVB Rev.C开发板测试
查询手册,USER_NVR的地址区域为0x10030000-0x100303FF,共1KB;66dd21ae-3340-4a28-b91b-d3b03a30642d-image.png Flash_Disable_Jtag_Demo工程中,有对CUS_NVR进行读擦写操作,直接下载测试;
e3dcc63b-036d-41fe-be2f-764bb45a6373-image.png 读、擦、写测试成功。
4723e3a3-348b-4d1a-9006-ba5a5fda8618-image.png
测试代码
Flash_Disable_Jtag_Demo.zip
Dear Yuntu Support Team,
I hope you are doing well.
I am currently working with the YTM32B1MD microcontroller series and using the on‑chip CRC32 hardware module to verify firmware integrity. However, we have observed that the CRC32 result generated by the Yuntu hardware CRC engine does not match the CRC32 result produced by the IAR ielftool (CRC32/Ethernet configuration).
To ensure our firmware integrity workflow is correct, we would like to request official confirmation of the exact CRC32 parameters used by the Yuntu CRC hardware.
Specifically, could you please help confirm the following details?
We currently understand the polynomial as:
X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 + X^8 + X^7 + X^5 + X^4 + X^2 + X + 1
which corresponds to 0x04C11DB7 (CRC‑Ethernet / IEEE 802.3).
Please confirm whether this is correct.
Does the Yuntu CRC module perform:
REFIN (bit reflection on input bytes)?
REFOUT (bit reflection on the final CRC value)?
What is the default initial value used by the hardware?
(e.g., 0xFFFFFFFF, 0x00000000, or another value)
Does the hardware apply a final XOR (e.g., 0xFFFFFFFF) automatically, or should this be done in software?
Byte Ordering / Word FeedingWhen feeding 32‑bit data into the CRC module:
Should bytes be provided in little‑endian order?
Does the hardware internally reverse byte order?
Are there any Yuntu‑specific variations that may cause mismatch with tools such as IAR, Python, or standard CRC32 calculators?
Understanding these exact CRC parameters is important for us to:
Align our bootloader and firmware integrity checks Ensure IAR post‑build CRC matches Yuntu HW CRC results Comply with integrity requirements in our production workflowWe would greatly appreciate your guidance or example code/configuration showing the correct CRC32 usage for YTM32B1MD.
fdcc3fa0-dd3d-4050-b4c4-ee70ae4f9513-image.png
IAR generated CRC32
ielftool --checksum=__CRC32:4,crc32:i,0xFFFFFFFF;0x00000000-0x000203FB
firmware.out firmware_crc.out
1.背景
在PWM的下降沿触发ADC采集
2.需求
3.解决方案描述:
由于PWM模块没有提供MID值的设置API,采用手写代码设置MID值: eTMR0->SYNC |= eTMR_SYNC_CLDOK_MASK; eTMR0->MID = eTMR0->CH[0].VAL1; eTMR0->SYNC |= eTMR_SYNC_LDOK(1);
1d4fd905-ae3c-47d3-888c-f4ee53cb1bf2-image.png
测试波形:
bd8b3693-ae79-4952-81dd-89a6bb2aa4b6-image.png
示例工程:12694718-26d0-4c88-a824-16035e3174d3-Adc_HwTrig_Demo.zip
我尝试为 openocd 添加 pflash 写入功能,根据手册和 demo 的描述,pflash 单次写入要 32 字节,目前每32字节都要根据这个流程处理一遍,使用 jlink 测试下载的速度大概在 1KB/s,
> flash write_image Hello_World.hex Padding image section 0 at 0x020000a0 with 1888 bytes Padding image section 1 at 0x02000bd4 with 44 bytes Padding image section 2 at 0x02004e68 with 24 bytes (bank write end alignment) wrote 20096 bytes from file Hello_World.hex in 13.192564s (1.488 KiB/s)请问有没有提高速度的方向或者思路?
-
Announcements
Announcements regarding our community
-
Discussion & Question
A place to talk about whatever you want or ask a question
-
Blogs
Blog posts from individual members
快速上手云途开发生态
发帖前请查看
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...