Skip to content

Commit 54441e2

Browse files
committed
Initial commit
1 parent 9230511 commit 54441e2

File tree

3,388 files changed

+582553
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,388 files changed

+582553
-0
lines changed

Makefile

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
TARGET = firmware
2+
3+
BSP_DEFINITIONS := $(wildcard hardware/*/*.def)
4+
BSP_HEADERS := $(patsubst hardware/%,bsp/%,$(BSP_DEFINITIONS))
5+
BSP_HEADERS := $(patsubst %.def,%.h,$(BSP_HEADERS))
6+
7+
OBJS =
8+
# Startup files
9+
OBJS += start.o
10+
OBJS += init.o
11+
OBJS += sram-overlay.o
12+
OBJS += external/printf/printf.o
13+
14+
# Drivers
15+
OBJS += driver/adc.o
16+
OBJS += driver/aes.o
17+
OBJS += driver/backlight.o
18+
OBJS += driver/bk1080.o
19+
OBJS += driver/bk4819.o
20+
OBJS += driver/crc.o
21+
OBJS += driver/eeprom.o
22+
OBJS += driver/flash.o
23+
OBJS += driver/gpio.o
24+
OBJS += driver/i2c.o
25+
OBJS += driver/keyboard.o
26+
OBJS += driver/spi.o
27+
OBJS += driver/st7565.o
28+
OBJS += driver/system.o
29+
OBJS += driver/systick.o
30+
OBJS += driver/uart.o
31+
32+
# Main
33+
OBJS += app/action.o
34+
OBJS += app/aircopy.o
35+
OBJS += app/app.o
36+
OBJS += app/dtmf.o
37+
OBJS += app/fm.o
38+
OBJS += app/generic.o
39+
OBJS += app/main.o
40+
OBJS += app/menu.o
41+
OBJS += app/scanner.o
42+
OBJS += app/uart.o
43+
OBJS += audio.o
44+
OBJS += bitmaps.o
45+
OBJS += board.o
46+
OBJS += dcs.o
47+
OBJS += font.o
48+
OBJS += frequencies.o
49+
OBJS += functions.o
50+
OBJS += helper/battery.o
51+
OBJS += helper/boot.o
52+
OBJS += misc.o
53+
OBJS += radio.o
54+
OBJS += scheduler.o
55+
OBJS += settings.o
56+
OBJS += ui/aircopy.o
57+
OBJS += ui/battery.o
58+
OBJS += ui/fmradio.o
59+
OBJS += ui/helper.o
60+
OBJS += ui/inputbox.o
61+
OBJS += ui/lock.o
62+
OBJS += ui/main.o
63+
OBJS += ui/menu.o
64+
OBJS += ui/rssi.o
65+
OBJS += ui/scanner.o
66+
OBJS += ui/status.o
67+
OBJS += ui/ui.o
68+
OBJS += ui/welcome.o
69+
OBJS += version.o
70+
71+
OBJS += main.o
72+
73+
ifeq ($(OS),Windows_NT)
74+
TOP := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
75+
else
76+
TOP := $(shell pwd)
77+
endif
78+
79+
AS = arm-none-eabi-as
80+
CC = arm-none-eabi-gcc
81+
LD = arm-none-eabi-gcc
82+
OBJCOPY = arm-none-eabi-objcopy
83+
SIZE = arm-none-eabi-size
84+
85+
#GIT_HASH := $(shell git rev-parse --short HEAD)
86+
87+
ASFLAGS = -mcpu=cortex-m0
88+
CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
89+
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
90+
#CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
91+
LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
92+
93+
# compilation options
94+
CFLAGS += -DDISABLE_NOAA
95+
CFLAGS += -DDISABLE_VOICE
96+
CFLAGS += -DDISABLE_AIRCOPY
97+
CFLAGS += -DKEEP_MEM_NAME
98+
#CFLAGS += -DDISABLE_ALARM
99+
#CFLAGS += -DBAND_SCOPE
100+
101+
ifeq ($(DEBUG),1)
102+
ASFLAGS += -g
103+
CFLAGS += -g
104+
LDFLAGS += -g
105+
endif
106+
107+
INC =
108+
INC += -I $(TOP)
109+
INC += -I $(TOP)/external/CMSIS_5/CMSIS/Core/Include/
110+
INC += -I $(TOP)/external/CMSIS_5/Device/ARM/ARMCM0/Include
111+
112+
LIBS =
113+
114+
DEPS = $(OBJS:.o=.d)
115+
116+
all: $(TARGET)
117+
$(OBJCOPY) -O binary $< $<.bin
118+
# -python fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
119+
# -python3 fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
120+
$(SIZE) $<
121+
122+
debug:
123+
/opt/openocd/bin/openocd -c "bindto 0.0.0.0" -f interface/jlink.cfg -f dp32g030.cfg
124+
125+
flash:
126+
/opt/openocd/bin/openocd -c "bindto 0.0.0.0" -f interface/jlink.cfg -f dp32g030.cfg -c "write_image firmware.bin 0; shutdown;"
127+
128+
version.o: .FORCE
129+
130+
$(TARGET): $(OBJS)
131+
$(LD) $(LDFLAGS) $^ -o $@ $(LIBS)
132+
133+
bsp/dp32g030/%.h: hardware/dp32g030/%.def
134+
135+
%.o: %.c | $(BSP_HEADERS)
136+
$(CC) $(CFLAGS) $(INC) -c $< -o $@
137+
138+
%.o: %.S
139+
$(AS) $(ASFLAGS) $< -o $@
140+
141+
.FORCE:
142+
143+
-include $(DEPS)
144+
145+
clean:
146+
rm -f $(TARGET).bin $(TARGET) $(OBJS) $(DEPS)
147+

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Open reimplementation of the Quan Sheng UV K5 v2.1.27 firmware
2+
3+
This repository is a cloned and customized version of DualTachyon's firmware found here ..
4+
5+
https://github.com/DualTachyon/uv-k5-firmware
6+
7+
# User customization
8+
9+
This version you can customize at compile time by making various changes to the makefile.
10+
You can edit those changes by (currently) editing the MakeFile, look for these lines ..
11+
12+
"# compilation options"
13+
"CFLAGS += -DDISABLE_NOAA" .. remove NOAA channels option from the firmware
14+
"CFLAGS += -DDISABLE_VOICE" .. remove spoken VOICES option from the firmware
15+
"CFLAGS += -DDISABLE_AIRCOPY" .. remove AIRCOPY option
16+
"CFLAGS += -DKEEP_MEM_NAME" .. don't wipe out the memory channel's name when saving a memory channel
17+
"#CFLAGS += -DDISABLE_ALARM" .. not yet implemented
18+
"#CFLAGS += -DBAND_SCOPE" .. not yet implemented
19+
20+
To enable the custom option just uncomment the line by removing the starting '#'.
21+
22+
# Other changes made
23+
24+
25+
# Compiler
26+
27+
arm-none-eabi GCC version 10.3.1 is recommended, which is the current version on Ubuntu 22.04.03 LTS.
28+
Other versions may generate a flash file that is too big.
29+
You can get an appropriate version from: https://developer.arm.com/downloads/-/gnu-rm
30+
31+
# Building
32+
33+
To build the firmware, you need to fetch the submodules and then run make:
34+
```
35+
git submodule update --init --recursive --depth=1
36+
make
37+
```
38+
39+
You can also easily compile this in windows (will an an example shortly) meaning you no longer have to install a linux VM on Windows.
40+
41+
# Credits
42+
43+
Many thanks to various people on Telegram for putting up with me during this effort and helping:
44+
45+
* [Mikhail](https://github.com/fagci/)
46+
* [Andrej](https://github.com/Tunas1337)
47+
* @wagner
48+
* @Lohtse Shar
49+
* [@Matoz](https://github.com/spm81)
50+
* @Davide
51+
* @Ismo OH2FTG
52+
* and others I forget
53+
54+
# License
55+
56+
Copyright 2023 Dual Tachyon
57+
https://github.com/DualTachyon
58+
59+
Licensed under the Apache License, Version 2.0 (the "License");
60+
you may not use this file except in compliance with the License.
61+
You may obtain a copy of the License at
62+
63+
http://www.apache.org/licenses/LICENSE-2.0
64+
65+
Unless required by applicable law or agreed to in writing, software
66+
distributed under the License is distributed on an "AS IS" BASIS,
67+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
68+
See the License for the specific language governing permissions and
69+
limitations under the License.
70+

0 commit comments

Comments
 (0)