stm32

Make CRC on stm32 match with software implementation

限于喜欢 提交于 2021-02-19 04:22:45
问题 Upd. See the end of post for working code I'm already mad with this. How can I make checksum from CRC unit on stm32f103 match with software implementation? Stm has polynom 0x04C11DB7 and reset value 0xFFFFFFFF . So I've tried to calculate it in python. Code for stm: uint32_t crc32_hard_block(uint32_t *buf, uint32_t len) { CRC_ResetDR(); uint32_t crc = CRC_CalcBlockCRC(buf, len); return crc; } uint32_t buf[4] = {50, 10, 243, 147}; uint32_t crc_hard_block = crc32_hard_block(buf, 4); Code for

STM32 HSE unstable frequency

你说的曾经没有我的故事 提交于 2021-02-11 16:36:38
问题 I'm trying to run my Nucleo f401re on 80mhz from HSE int F4xxx::clockInit(int pllM, int pllN, int pllP, int pllQ) { enableHse(); //FLASH CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN); FLASH->ACR&= ~FLASH_ACR_LATENCY; FLASH->ACR |= FLASH_ACR_LATENCY_5WS | FLASH_ACR_ICEN | FLASH_ACR_DCEN|FLASH_ACR_PRFTEN; //set HSE as PLL source RCC->PLLCFGR = RCC_PLLCFGR_PLLSRC_HSE; // RCC->CR &= ~(RCC_CR_PLLON); //disable PLL before changes // RCC->PLLCFGR = pllM|(pllN<<6)|(((pllP>>1)-1)<<16)|RCC_PLLCFGR_PLLSRC_HSE

STM32 HSE unstable frequency

别说谁变了你拦得住时间么 提交于 2021-02-11 16:35:51
问题 I'm trying to run my Nucleo f401re on 80mhz from HSE int F4xxx::clockInit(int pllM, int pllN, int pllP, int pllQ) { enableHse(); //FLASH CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN); FLASH->ACR&= ~FLASH_ACR_LATENCY; FLASH->ACR |= FLASH_ACR_LATENCY_5WS | FLASH_ACR_ICEN | FLASH_ACR_DCEN|FLASH_ACR_PRFTEN; //set HSE as PLL source RCC->PLLCFGR = RCC_PLLCFGR_PLLSRC_HSE; // RCC->CR &= ~(RCC_CR_PLLON); //disable PLL before changes // RCC->PLLCFGR = pllM|(pllN<<6)|(((pllP>>1)-1)<<16)|RCC_PLLCFGR_PLLSRC_HSE

How do you use CMSIS without an IDE?

二次信任 提交于 2021-02-10 12:15:47
问题 I am working with STM32F103C8T6 and would like to use CMSIS, which is essentially just register definitions and no code, to make my life easier while still staying at a low level. The problem is that I have no idea how to install the library for use on the command line with Makefile. All documentation seems to be bound with a vendor-specific IDE like STM32CubeIDE. I suppose the first thing to do is to download the CMSIS library, which I found on GitHub. However, after unzipping ARM.CMSIS.5.6

Convert a ARM gcc generated library from one soft float bi to hard float abi

扶醉桌前 提交于 2021-02-10 09:22:09
问题 I need to link my firmware (running on STM32L4x6, built with arm-none-eabi_gcc) with two third party libraries (I don't have the source code of these libs). One lib is compiled using hard float abi, and the other is not using float at all and linked probably with soft float abi. I know both abis are not compatible and I fully understand the difference between them, but what if a library does not use float operation at all ? What is preventing to link it with some other code using whatever abi

Convert a ARM gcc generated library from one soft float bi to hard float abi

蹲街弑〆低调 提交于 2021-02-10 09:20:57
问题 I need to link my firmware (running on STM32L4x6, built with arm-none-eabi_gcc) with two third party libraries (I don't have the source code of these libs). One lib is compiled using hard float abi, and the other is not using float at all and linked probably with soft float abi. I know both abis are not compatible and I fully understand the difference between them, but what if a library does not use float operation at all ? What is preventing to link it with some other code using whatever abi

Convert a ARM gcc generated library from one soft float bi to hard float abi

雨燕双飞 提交于 2021-02-10 09:20:30
问题 I need to link my firmware (running on STM32L4x6, built with arm-none-eabi_gcc) with two third party libraries (I don't have the source code of these libs). One lib is compiled using hard float abi, and the other is not using float at all and linked probably with soft float abi. I know both abis are not compatible and I fully understand the difference between them, but what if a library does not use float operation at all ? What is preventing to link it with some other code using whatever abi

Convert a ARM gcc generated library from one soft float bi to hard float abi

青春壹個敷衍的年華 提交于 2021-02-10 09:17:12
问题 I need to link my firmware (running on STM32L4x6, built with arm-none-eabi_gcc) with two third party libraries (I don't have the source code of these libs). One lib is compiled using hard float abi, and the other is not using float at all and linked probably with soft float abi. I know both abis are not compatible and I fully understand the difference between them, but what if a library does not use float operation at all ? What is preventing to link it with some other code using whatever abi

From makefile to Cmake - stm32

徘徊边缘 提交于 2021-02-08 11:11:01
问题 I would like to test CLion for my stm32 project since it now support remote debugging! To do so I need to setup Cmake for my project and it is my issue. I tried using this link which seems to be depreciated so I made some changes. It almost builds but there is a problem with the .elf .bin .hex. CMakeLists.txt: project(F466cmake) cmake_minimum_required(VERSION 3.10) add_definitions(-DSTM32F446xx) file(GLOB_RECURSE USER_SOURCES "Src/*.c") file(GLOB_RECURSE HAL_SOURCES "Drivers/STM32F4xx_HAL

STM32 unaligned access

随声附和 提交于 2021-02-08 10:31:09
问题 Periodically, the program enters the HardFault_Handler. In the register HFSR set bit FORCED and in UFSR register set UNALIGNED . The project uses STM32F417, FreeRtos, LWIP. In most cases, the error in the stack are LWIP function. The error occurs rarely once a few days. The program is compiled with the flag --no_unaligned_access . It is unclear why there is such an error - while --no_unaligned_access flag is enabled and even every few days, and second whether it is possible to process or