Keil
Making it more comfortable to look at
Making it more comfortable to look at
I've used LVGL a lot before and even ported it to microcontrollers, but I've never studied it systematically — I'm still at a superficial level. So I plan to study LVGL properly, though not all that properly. How should I put it — watch me learn, and you'll pick it up too.
I plan to learn lwIP based on the tutorials from ALIENTEK (正点原子). The board I'm using is an ALIENTEK stm32f407zgt6 minimum system board plus a LAN8720A for network communication.
The development IDE is CLion, using the open-source embedded toolchain: arm-gnu-toolchain-15.3.rel1-mingw-w64-i686-arm-none-eabi
Reference book: 《lwIP开发指南_V1.7.pdf》
Taking some real code as examples:
ifneq ($(MKENV_INCLUDED),1)
include mkenv.mk
endif
subdirs-y :=
include apps.mk
.PHONY: all clean distclean
all: $(subdirs-y)
@echo "Make Applications done."
ifneq ($(strip $(subdirs-y)),)
.PHONY: $(subdirs-y)
$(subdirs-y):
@echo "[BUILD] applications $@"
@$(MAKE) -C $@ all || exit $?;
endif
clean:
@if [ -n "$(subdirs-y)" ]; then \
for dir in $(subdirs-y); do \
echo "[CLEAN] applications $$dir"; \
$(MAKE) -C $$dir clean || exit $?; \
done; \
fi
distclean: clean
@if [ -n "$(subdirs-y)" ]; then \
for dir in $(subdirs-y); do \
echo "[DISTCLEAN] applications $$dir"; \
$(MAKE) -C $$dir distclean || exit $?; \
done; \
fi
.PHONY: gen_kconfig
gen_kconfig:
@echo "# Dynamic generate by Makefile, DO NOT Modify it.\n" > $(SDK_BUILD_DIR)/Kconfig.app; \
for dir in $(shell find $(SDK_APPS_SRC_DIR) -maxdepth 1 -mindepth 1 -type d); do \
echo "source \"$$dir/Kconfig\"" >> $(SDK_BUILD_DIR)/Kconfig.app; \
done; \
sudo apt update
sudo apt install docker.io
sudo usermod -aG docker $USER
newgrp docker # refresh the user group, or just log out and log back into the terminal
"Picture this, everyone: a microcontroller running code is just like you reading an incredibly thick novel (and that novel is the Flash memory).
Your eyes can't take in a whole page at once — you have to read it line by line. To keep from losing your place, you'd use your index finger to point at whatever line you're reading right now. Finish a line, and the finger slides down one line.
That index finger used for pointing the way is the PC (Program Counter)!
What the PC holds is always an address, which is basically telling you: 'Boss CPU, which line of code should be executed next?'
What if a phone call suddenly comes in (an interrupt)? What do you do? You'd write down where your finger is currently pointing on a slip of paper (saving the context), then run off to answer the call. When you're back, you glance at the slip of paper, point your finger back at that line, and keep reading! But if you forcibly bend that finger over to a blank page full of gibberish (say, pointing it at 0x00000000), you'll instantly freeze up and the whole thing dies — that's a HardFault!"
Summary: the value of the PC register is the location of the next piece of code to be executed — extremely important!!
The stm32f103c8t6 has 64KB of flash and 20KB of SRAM
The stm32f103c8t6 has 64KB of flash and 20KB of SRAM
0kb - 16kb: the first 16KB is the bootloader's space
16kb - 20Kb: the middle 4KB is the parameter area
20kb - 64KB: everything after that is the APP area