https://www.st.com/en/evaluation-tools/nucleo-f446re.html
stm32cubeIDE:
https://www.st.com/en/development-tools/stm32cubeide.html
sudo dnf install stlink
st-info
[fahmad@ryzen ~]$ st-info --probe
Found 1 stlink programmers
version: V2J33S25
serial: 066AFF505282494867173940
flash: 524288 (pagesize: 131072)
sram: 131072
chipid: 0x0421
descr: F446
in um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf
see Cortex-M4-devices-generic-user-guide.pdf
page 25.
__attribute__((naked)) function attribute
This attribute tells the compiler that the function is an embedded assembly function.
example
__attribute__((naked)) int add(int i, int j); /* Declaring a function with __attribute__((naked)). */
__attribute__((naked)) int add(int i, int j)
{
__asm("ADD r0, r1, #1"); /* Basic assembler statements are supported. */
/* Parameter references are not supported inside naked functions: */
// __asm (
// "ADD r0, %[input_i], %[input_j]" /* Assembler statement with parameter references */
// : /* Output operand parameter */
// : [input_i] "r" (i), [input_j] "r" (j) /* Input operand parameter */
// );
/* Mixing C code is not supported inside naked functions: */
/* int res = 0;
return res;
*/
}
go to https://github.com/ARM-software/abi-aa/releases , choose aapcs32.pdf
.
check cortexM4/007Stack/Debug/007Stack.list
-
Identify the IRQ number of the peripheral by referring to the MCU vector table. IRQ numbers are vendor-specific
-
Program the Processor register to enable that IRQ (only when you enable the IRQ, the processor will accept the interrupt over that line ).Set the priority (optional)
-
Configure the peripheral (USART3) using its peripheral configuration register. For example, in the case of USART3, whenever a packet is received, it will automatically issue an interrupt on the IRQ line 39.
-
When the interrupt is issued on the IRQ line, it will first get pended in the pending register of the processor.
-
NVIC will allow the IRQ handler associated with the IRQ number to run only if the priority of the new interrupts higher than the currently executing interrupt handler. Otherwise newly arrived interrupt will stay in pending state.
-
Please note that if peripheral issues an interrupt when the IRQ number is disabled (not activated from the processor side), then still interrupt will get pended in the pending register of the NVIC. As soon as IRQ is enabled, it will trigger the execution of the ISR if the priority is higher than the currently active ISR.
see rm0390-stm32f446xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
page 241. USART3 is in position 39
why we use ISPR1 ?
Interrupt Set-pending Registers contains NVIC_ISPR0-NVIC_ISPR7 registers. Each register can handle 32 IRQs. Since the IRQ is 39 (USART3), we have to use ISPR1.
- https://www.reddit.com/r/openSUSE/comments/zevkd9/fedora_dropped_ncurses_abi_5_how_would_opensuse/
- https://www.reddit.com/r/Fedora/comments/ygl7zy/can_we_bring_back_ncursescompatlibs_in_fedora_37/
down the deb
version of stm32 cube ide, extract it, and install it inside container.
toolbox enter ubuntu-toolbox-22.04
⬢[fahmad@toolbox deb]$ ls
st-stm32cubeide_1.11.0_13638_20221122_1308_amd64.deb_bundle.sh
⬢[fahmad@toolbox deb]$ sudo sh st-stm32cubeide_1.11.0_13638_20221122_1308_amd64.deb_bundle.sh
⬢[fahmad@toolbox ~]$ /opt/st/stm32cubeide_1.11.0/stm32cubeide
- Test-Driven Development for Embedded C (https://pragprog.com/titles/jgade/test-driven-development-for-embedded-c/)
- https://developer.arm.com/Processors/Cortex-M4
- https://electronics.stackexchange.com/questions/622968/some-questions-about-crystal-oscillators-of-an-stm32-microcontroller-board
- https://www.st.com/content/st_com/en/stm32-mcu-developer-zone.html
- https://github.com/prtzl/Embedded_videos
- https://github.com/davisjp1822/stm32_nucleo_linux
- https://github.com/cnoviello/mastering-stm32-2nd
- https://leanpub.com/mastering-stm32-2nd
- https://www.amazon.com/Joseph-Yiu/e/B001IQWINC/ref=sr_ntt_srch_lnk_2?qid=1443620939&sr=8-2-fkmr0
- https://www.udemy.com/share/101rCk3@h6VIEb91dmd0NDr6RlJGG-Fzr2c7KKYor7UAgBj15f-Cs6ZDh6L9B2aWqXMeKfSQ/
- https://www.udemy.com/share/101X3i3@rjXmCKUFlkt7bzjUuiH6TJxIJWmwE1CTM0rlJF2D349wt4IZZgGJuVQGxUDpUCtO/
- https://www.udemy.com/share/101XJQ3@jUor6jCAyQHJHKSK0i7XJkGxA2LGn2In-wDvf1MdP7TN51VnLip-rMJQptw7PDhy/