stm32

HID report not working while changed length

二次信任 提交于 2021-02-08 05:45:56
问题 I'm building a custom keyboard with stm32f103. My first trial with standard 8 byte works pretty well: 0x05, 0x01, // Usage Page (Generic Desktop) 0x09, 0x06, // Usage (Keyboard) 0xA1, 0x01, // Collection (Application) //Modifiers 0x05, 0x07, // Usage Page (Key Codes) 0x19, 0xe0, // Usage Minimum (224) 0x29, 0xe7, // Usage Maximum (231) 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x75, 0x01, // Report Size (1) 0x95, 0x08, // Report Count (8) 0x81, 0x02, // Input (Data

How will circular DMA periph to memory behave at the end of the transfer in STM32?

江枫思渺然 提交于 2021-02-07 04:14:30
问题 I wanted to ask, how will behave DMA SPI rx in STM32 in following situation. I have a specified (for example) 96 Bytes array called A which is intended to store the data received from the SPI. I turn on my circular SPI DMA which operates on each Byte, is configured to 96 Byte. Is it possible, when DMA will fill my 96 Bytes array, the Transfer Complete interrupt will went off, to quickly copy the 96 Byte array to another - B, before circular DMA will start writing to A(and destroy the data

How will circular DMA periph to memory behave at the end of the transfer in STM32?

ⅰ亾dé卋堺 提交于 2021-02-07 04:08:23
问题 I wanted to ask, how will behave DMA SPI rx in STM32 in following situation. I have a specified (for example) 96 Bytes array called A which is intended to store the data received from the SPI. I turn on my circular SPI DMA which operates on each Byte, is configured to 96 Byte. Is it possible, when DMA will fill my 96 Bytes array, the Transfer Complete interrupt will went off, to quickly copy the 96 Byte array to another - B, before circular DMA will start writing to A(and destroy the data

Where is the specific address definition of the GPIO IDR register by STM32Cube resulting files?

我是研究僧i 提交于 2021-01-29 11:02:01
问题 I have read through the explanation of the STM32 project produced by the STM32Cube as in this website. From this website, I have learned that: In the stm32f0xx.h file, for example, the origianl address of GPIOA is already declared by "#define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000U)" then all the corresponding registers for GPIOA is declared by "#define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)" By the information above, this head file has already defined the original adress of GPIOA, and declared

How to do a adc conversion every 1us with Nucleo-F303K8?

末鹿安然 提交于 2021-01-29 07:49:20
问题 Im using the STM32 Cube IDE. What I tried now is enable MSM in TIM2 and output_compare_no_output on Channel 1 and select "Reset" as the Trigger Event. Then I went to ADC1 and enabled Regular_Conversion_Mode, set Number_Of_Conversions to 1 and the External_Trigger_Conversion_Source to Timer 2 Trigger Out event. After that I set up a DMA in circular mode that pushes half-words to a RAM buffer. For testing I've set the frequency of the timer a lot lower (10Hz) and send some ADC readings from the

How to do a adc conversion every 1us with Nucleo-F303K8?

纵饮孤独 提交于 2021-01-29 07:27:03
问题 Im using the STM32 Cube IDE. What I tried now is enable MSM in TIM2 and output_compare_no_output on Channel 1 and select "Reset" as the Trigger Event. Then I went to ADC1 and enabled Regular_Conversion_Mode, set Number_Of_Conversions to 1 and the External_Trigger_Conversion_Source to Timer 2 Trigger Out event. After that I set up a DMA in circular mode that pushes half-words to a RAM buffer. For testing I've set the frequency of the timer a lot lower (10Hz) and send some ADC readings from the

Why does my interrupt get called, but won't enter the handler?

[亡魂溺海] 提交于 2021-01-29 05:40:38
问题 I'm trying to recieve communication from an USART in interrupt mode. The debugger shows me that the interrupt is getting called on a keypress, but the execution gets stuck in the vector table definition. I initialize my usart with the following. static void MX_USART2_UART_Init(void) { huart2.Instance = USART2; huart2.Init.BaudRate = 19200; huart2.Init.WordLength = UART_WORDLENGTH_8B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_TX

Newer version of GCC throws reinterpret_cast error

痞子三分冷 提交于 2021-01-28 14:09:48
问题 I am developing an embedded project (on STM32). I currently use GCC 4.9.2, but I would like to switch to newer version of my toolchain. Unfortunately my code which succesfully compiles on gcc 4.9.2, throws reinpreted_cast errors on version 6.2.0 or 7.2.0 and I have no idea why. It looks like that newer gcc sees some problems when casting int to pointer and back to int - which I think should be quite normal operation. Error message thrown: 1>STM32L4\CMSIS\stm32l4a6xx.h(1567,30): error :

How the callback functions work in stm32 Hal Library?

岁酱吖の 提交于 2021-01-28 07:38:41
问题 As we all know,the Hal Lib provides some callback function to manage hardware interrupt.But i don't know how them work? Te fact is that I am using HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) this function so as to receive other devices' data and check those data.So I use the usart interrupt to receive them. But I don't know when the callback function will be executed,is it depends on the receive buffer's length or the data's buffer? I guess the hardware interrupt will be triggered

Change priority level level of running interrupt handler?

前提是你 提交于 2021-01-27 05:49:23
问题 I am trying to implement the following pseudocode on a cortex-m3 controller, (STM32L151 in particular) void SysTick_Handler() { do_high_priority_periodic_tasks(); // not to be interrupted lower_interrupt_priority(); do_low_priority_periodic_tasks(); // these may be interrupted } In other words, run the first part with priority level 0, then somehow lower the current interrupt priority to 15, so that the rest could be preempted by other hardware interrupts. One idea is to move do_low_priority