Giter Site home page Giter Site logo

joaquimorg / uv-k5-firmware-custom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from egzumer/uv-k5-firmware-custom

75.0 11.0 21.0 56.31 MB

Open implementation of the Quansheng UV-K5/K6/5R firmware

Home Page: https://www.joaquim.org

License: Apache License 2.0

Shell 0.02% C++ 1.06% Python 0.14% C 97.11% Assembly 0.31% Makefile 1.11% Batchfile 0.22% Dockerfile 0.04%
quansheng uv-k5

uv-k5-firmware-custom's Introduction

Warning

This repository is not intended to be a final version with 100% of all features, there may even be some features present in the original that are not here. What I want with this repository is to have a place to experiment with new features that I find interesting, these features can and should be used in other repositories and improved. I would like to thank everyone who reports problems they have encountered, however these may not be resolved. If you want to have a more stable FW and even with more features, I advise you to look at other options.

Open re-implementation of the Quansheng UV-K5/K6/5R v2.1.27 firmware

This repository is a merge of OneOfEleven custom firmware with fagci spectrum analizer and others.
All is a cloned and customized version of DualTachyon's open firmware found here ... a cool achievement !

Tip

Same work done by others. I encourage you to take a look at those for a more stable and complete FW.
OneOfEleven
DualTachyon
Mikhail
Nunu (kamilsss655)
Andrej (Tunas1337)
Manuel
@Matoz (spm81)
OneOfEleven

Warning

Use this firmware at your own risk (entirely). There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), in which case, you'd need to buy another radio.

Warning

After some unfortunate incidents by users I'm going to put this warning and disclaimer up. DO NOT attempt to transmit without the proper precautions in place. Transmitting 5W of RF energy centimetres away from a PC can LITERALLY destroy it, it's almost like an EMP at that distance. Get your antenna away from the PC.

Anyway, have fun.

Table of Contents

Main features:

  • many of OneOfEleven mods:
    • AM fix, huge improvement in reception quality
    • long press buttons functions replicating F+ action
    • fast scanning
    • channel name editing in the menu
    • channel name + frequency display option
    • shortcut for scan-list assignment (long press 5 NOAA)
    • scan-list toggle (long press * Scan while scanning)
    • configurable button function selectable from menu
    • battery percentage/voltage on status bar, selectable from menu
    • longer backlight times
    • mic bar
    • RSSI s-meter
    • more frequency steps
    • squelch more sensitive
  • fagci spectrum analyzer (F+5 to turn on)
  • some other mods introduced by me:
    • SSB demodulation (adopted from fagci)
    • backlight dimming
    • battery voltage calibration from menu
    • better battery percentage calculation, selectable for 1600mAh or 2200mAh
    • more configurable button functions
    • long press MENU as another configurable button
    • better DCS/CTCSS scanning in the menu (* SCAN while in RX DCS/CTCSS menu item)
    • Piotr022 style s-meter
    • restore initial freq/channel when scanning stopped with EXIT, remember last found transmission with MENU button
    • reordered and renamed menu entries
    • LCD interference crash fix
    • many others...

Manual

Up to date manual is available in the Wiki section

Radio performance

Please note that the Quansheng UV-Kx radios are not professional quality transceivers, their performance is strictly limited. The RX front end has no track-tuned band pass filtering at all, and so are wide band/wide open to any and all signals over a large frequency range.

Using the radio in high intensity RF environments will most likely make reception anything but easy (AM mode will suffer far more than FM ever will), the receiver simply doesn't have a great dynamic range, which results in distorted AM audio with stronger RX'ed signals. There is nothing more anyone can do in firmware/software to improve that, once the RX gain adjustment I do (AM fix) reaches the hardwares limit, your AM RX audio will be all but non-existent (just like Quansheng's firmware). On the other hand, FM RX audio will/should be fine.

But, they are nice toys for the price, fun to play with.

User customization

You can customize the firmware by enabling/disabling various compile options, this allows us to remove certain firmware features in order to make room in the flash for others. You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) ..

Build option Description
🧰 STOCK QUANSHENG FEATURES
ENABLE_UART without this you can't configure radio via PC !
ENABLE_AIRCOPY easier to just enter frequency with butts
ENABLE_FMRADIO WBFM VHF broadcast band receiver
ENABLE_NOAA everything NOAA (only of any use in the USA)
ENABLE_VOICE want to hear voices ?
ENABLE_VOX
ENABLE_ALARM TX alarms
ENABLE_TX1750 side key 1750Hz TX tone (older style repeater access)
ENABLE_PWRON_PASSWORD power-on password stuff
ENABLE_DTMF_CALLING DTMF calling fuctionality, sending calls, receiving calls, group calls, contacts list etc.
ENABLE_FLASHLIGHT enable top flashlight LED (on, blink, SOS)
🧰 CUSTOM MODS
ENABLE_BIG_FREQ big font frequencies (like original QS firmware)
ENABLE_SMALL_BOLD bold channel name/no. (when name + freq channel display mode)
ENABLE_CUSTOM_MENU_LAYOUT changes how the menu looks like
ENABLE_KEEP_MEM_NAME maintain channel name when (re)saving memory channel
ENABLE_WIDE_RX full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
ENABLE_TX_WHEN_AM allow TX (always FM) when RX is set to AM
ENABLE_F_CAL_MENU enable the radios hidden frequency calibration menu
ENABLE_CTCSS_TAIL_PHASE_SHIFT standard CTCSS tail phase shift rather than QS's own 55Hz tone method
ENABLE_BOOT_BEEPS gives user audio feedback on volume knob position at boot-up
ENABLE_SHOW_CHARGE_LEVEL show the charge level when the radio is on charge
ENABLE_REVERSE_BAT_SYMBOL mirror the battery symbol on the status bar (+ pole on the right)
ENABLE_NO_CODE_SCAN_TIMEOUT disable 32-sec CTCSS/DCS scan timeout (press exit butt instead of time-out to end scan)
ENABLE_SQUELCH_MORE_SENSITIVE make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
ENABLE_FASTER_CHANNEL_SCAN increases the channel scan speed, but the squelch is also made more twitchy
ENABLE_RSSI_BAR enable a dBm/Sn RSSI bar graph level in place of the little antenna symbols
ENABLE_AUDIO_BAR experimental, display an audio bar level when TX'ing
ENABLE_COPY_CHAN_TO_VFO copy current channel settings into frequency mode. Long press 1 BAND when in channel mode
ENABLE_SPECTRUM fagci spectrum analyzer, activated with F + 5 NOAA
ENABLE_REDUCE_LOW_MID_TX_POWER makes medium and low power settings even lower
ENABLE_BYP_RAW_DEMODULATORS additional BYP (bypass?) and RAW demodulation options, proved not to be very useful, but it is there if you want to experiment
ENABLE_BLMIN_TMP_OFF additional function for configurable buttons that toggles BLMin on and off wihout saving it to the EEPROM
ENABLE_SCAN_RANGES scan range mode for frequency scanning, see wiki for instructions (radio operation -> frequency scanning)
🧰 DEBUGGING
ENABLE_AGC_SHOW_DATA displays AGC settings
ENABLE_UART_RW_BK_REGS adds 2 extra commands that allow to read and write BK4819 registers
🧰 COMPILER/LINKER OPTIONS
ENABLE_CLANG **experimental, builds with clang instead of gcc (LTO will be disabled if you enable this)
ENABLE_SWD only needed if using CPU's SWD port (debugging/programming)
ENABLE_OVERLAY cpu FLASH stuff, not needed
ENABLE_LTO reduces size of compiled firmware but might break EEPROM reads (OVERLAY will be disabled if you enable this)
🤖 joaquim.org
ENABLE_MESSENGER send and receive short text messages ( key = F + MENU )
ENABLE_MESSENGER_DELIVERY_NOTIFICATION send notification to sender if message received
ENABLE_MESSENGER_NOTIFICATION play sound when message received
ENABLE_MESSENGER_UART send and receive short text messages via UART (to send write «SMS:Text to send»)
ENABLE_PMR_MODE set the radio in PMR only operation ( work in progress )

Compiler

arm-none-eabi GCC version 10.3.1 is recommended, which is the current version on Ubuntu 22.04.03 LTS. Other versions may generate a flash file that is too big. You can get an appropriate version from: https://developer.arm.com/downloads/-/gnu-rm

clang may be used but isn't fully supported. Resulting binaries may also be bigger. You can get it from: https://releases.llvm.org/download.html

Building

Github Codespace build method

This is the least demanding option as you don't have to install enything on your computer. All you need is Github account.

  1. Go to https://github.com/egzumer/uv-k5-firmware-custom
  2. Click green Code button
  3. Change tab from Local to Codespace
  4. Click green Create codespace on main button

  1. Open Makefile
  2. Edit build options, save Makefile changes
  3. Run ./compile-with-docker.sh in terminal window
  4. Open folder compiled-firmware
  5. Right click firmware.packed.bin
  6. Click Download, now you should have a firmware on your computer that you can proceed to flash on your radio. You can use online flasher

Docker build method

If you have docker installed you can use compile-with-docker.bat (Windows) or compile-with-docker.sh (Linux/Mac), the output files are created in compiled-firmware folder. This method gives significantly smaller binaries, I've seen differences up to 1kb, so it can fit more functionalities this way. The challenge can be (or not) installing docker itself.

Windows environment build method

  1. Open windows command line and run:
    winget install -e -h git.git Python.Python.3.8 GnuWin32.Make
    winget install -e -h Arm.GnuArmEmbeddedToolchain -v "10 2021.10"
    
  2. Close command line, open a new one and run:
    pip install --user --upgrade pip
    pip install crcmod
    mkdir c:\projects & cd /D c:/projects
    git clone https://github.com/egzumer/uv-k5-firmware-custom.git
    
  3. From now on you can build the firmware by going to c:\projects\uv-k5-firmware-custom and running win_make.bat or by running a command line:
    cd /D c:\projects\uv-k5-firmware-custom
    win_make.bat
    
  4. To reset the repository and pull new changes run (!!! it will delete all your changes !!!):
    cd /D c:\projects\uv-k5-firmware-custom
    git reset --hard & git clean -fd & git pull
    

I've left some notes in the win_make.bat file to maybe help with stuff.

Credits

Many thanks to various people on Telegram for putting up with me during this effort and helping:

Other sources of information

ludwich66 - Quansheng UV-K5 Wiki
amnemonic - tools and sources of information

License

Copyright 2023 Dual Tachyon
https://github.com/DualTachyon

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Example changes/updates

Video showing the AM fix working ..

AM_fix.mp4

My changes to the main branch

  • Changes to Spectrum :
    • Frequency Presets
    • Frequency in Bold
    • Show channel name

  • Main display

  • Messenger, send and receive short text messages, write with T9 keyboard.

Keys :

  • "*" - Change keyboard, Upper case, Lower case, Numeric.
  • "0" - Space, except in numeric mode.
  • "F" - Backspace
  • "(Long press) F" - Clear all messages
  • "UP" - Recalls last sent message
  • "M" - Transmits message in the frequency of active VFO.
  • "Exit" - Close application

uv-k5-firmware-custom's People

Contributors

bg8lgp avatar bogdanbrudiu avatar bricky149 avatar egzumer avatar eriks-web avatar g4eml avatar joaquimorg avatar joecotton avatar joematthews avatar juantaldea avatar lollodev5123 avatar losehu avatar matiasfernandez avatar oneofeleven avatar piotr-wrobel avatar spm81 avatar westhecool avatar wutje avatar yurisu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uv-k5-firmware-custom's Issues

SMS text size

Even with 2.5+ bifocals the text is very hard to read. It would be great if it was the size of the"Messenger" header.

spectrum issue when using AM

Not sure what the issue here actually is so hoping you can shed some light....

Compiled and flashed using the lasted updates as of this comment. But as with previous builds I have an odd issue if I switch to spectrum and the radio is set to listen to any AM band with in the 127.xxx and 129.xxx ranges. The radio Locks up and the spectrum displays 000.00000 for the Frq only wat to resolve is a reboot... If I make sure before switching that I am on any other FRQ (eg any 15x.xx or 4xx.xx) There is no issues, and to date and I can set the Spectrum Frq to the range Am range but it struggles to lock on to a signal I have only had issues with previous and current builds with the ranges mentioned...

Any info or advice would be appreciate as to a possible cause.

not exporting

LD _build/cfw_joaquimorg_oefw_V0.3.3.out
Memory region Used Size Region Size %age Used
FLASH: 56584 B 60 KB 92.10%
RAM: 3340 B 16 KB 20.39%
Create cfw_joaquimorg_oefw_V0.3.3.out
Create cfw_joaquimorg_oefw_V0.3.3.packed.bin
cp: -r not specified; omitting directory 'firmware'

image

not in the firmware dir

TX becomes stuck on

Title pretty much says it all.

Repro steps:

  1. turn the radio on
  2. transmit and then let go of the PTT
    Observed behavior: radio remains in TX mode, but also the amplifier/TX path is disengaged (i.e. it's not actually transmitting beyond the BK4819, it's not pushing the full power)

I will look into what is causing this behavior.

error

app/app.c: In function 'HandleVox':
app/app.c:788:33: error: too few arguments to function 'APP_EndTransmission'
788 | APP_EndTransmission();
| ^~~~~~~~~~~~~~~~~~~
app/app.c:732:6: note: declared here
732 | void APP_EndTransmission(bool inmediately)
| ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:482: _build/app/app.o] Error 1

the last 4 options are missing

the last 4 options are missing i tried compiling manually adding them and without them and still fails this is the error that its giving me: /usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: firmware section .text' will not fit in region FLASH'
/usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 2112 bytes
collect2: error: ld returned 1 exit status
make: *** [Makefile:443: firmware] Error 1

Compilation error (error: 'MSG_Send' reading 30 bytes from a region of size 8)

Hi! thanks for the messenger, it is awesome! I am trying to compile my own with VOX but following the codespaces I get this error:

app/messenger.c: In function 'MSG_StorePacket':
app/messenger.c:698:25: error: 'MSG_Send' reading 30 bytes from a region of size 8 [-Werror=stringop-overread]
  698 |                         MSG_Send("\x1b\x1b\x1bRCVD", true);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/messenger.c:698:25: note: referencing argument 1 of type 'const char[30]'
app/messenger.c:542:6: note: in a call to function 'MSG_Send'
  542 | void MSG_Send(const char txMessage[TX_MSG_LENGTH], bool bServiceMessage) {
      |      ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:488: _build/app/messenger.o] Error 1
@eried ➜ /workspaces/uv-k5-firmware-custom (main) $ 

is there is any extra step when compiling it?

# ---- STOCK QUANSHENG FERATURES ----
ENABLE_UART                   ?= 1
ENABLE_AIRCOPY                ?= 1
ENABLE_FMRADIO                ?= 1
ENABLE_NOAA                   ?= 0
ENABLE_VOICE                  ?= 0
ENABLE_VOX                    ?= 1
ENABLE_ALARM                  ?= 0
ENABLE_TX1750                 ?= 0
ENABLE_PWRON_PASSWORD         ?= 0
ENABLE_DTMF_CALLING           ?= 0
ENABLE_FLASHLIGHT             ?= 0

Messenger TX Hangs

Setting ENABLE_VOX and ENABLE_CTCSS_TAIL_PHASE_SHIFT in combination with:
ENABLE_SCAN_RANGES, ENABLE_COPY_CHAN_TO_VFO, ENABLE_DTMF_CALLING or ENABLE_TX_1750 causes messenger to hang when sending a transmission, running v. 0.2.1

EDIT: Update, I am not sure what exactly is causing the issue, for example. If I set ENABLE_VOX and ENABLE_COPY_CHAN_TO_VFO, messenger hangs during TX. However, if I only enable 1 of those 2, messenger works fine. So it is not specific modules causing the issue but rather specific combinations

POCSAG decode

Is it possible to decode pocsag message with the messenger?

Question about New UI

love the new ui's... ui (/tree/new_ui). but well. you cant even transmit, some frequency don't even receive, and so on. So is there a way to use the ui from the new_ui branch in the main branch? if so, how?

and if not, is there a way to at least add the saved channel names in the main menu ui next to the frequency?

Missing the FM Radio function

Thanks for the great messaging function.

But I miss the FM radio. I created my own firmware as described. Unfortunately, the text message function could not be selected. Is there a lack of storage space for the FM radio? thanks for your help. Greetings JOHANNES

AM RX

Hello, how are you?

In AM it is not 100% audible like other modifications.

I like how your screen looks in bold, on the spectrum will it be possible to make the numbers bigger and make it more attractive?

Greetings

Message delivered not working FW v 3.5

Thanks so much for this project. Particularly like the messaging feature.

Unfortunately whilst I can get messages to be received there is no delivery report on my device. I can see that is different to people who have covered it on youtube who report a + sign appearing next to the message to confirm receipt.

I flashed the latest version ( cfw_joaquimorg_oefw_V0.3.5.packed.bin ) unfortunately despite being otherwise absolutely perfect I cannot get it to show delivery reports. Messages arrive ok and the radios are set up identically.

Not sure if you've disabled this feature when compiling this binary or something for some reason? I've been conducting range tests and currently need to wait until I return to base station to see if the messages have been received on the second radio. Would be very handy if this feature were working but keen to be running the latest version rather than downgrade to get it working!

Any advice or assistance would be very much appreciated!

Licensing and attribution

Hey @joaquimorg I don't mind if you use my open source code like I used your messenger code.

However, keep in mind that this is decent and even required by most open-source licenses provides some form of attribution.

When I added your code, I added your github handle in the readme file to credit your contributions.

It would be nice if you could do the same. :)

Thank you.

Unable to Read EEPROM using k5prog or CHIRP

First, thanks for this excellent firmware. It is exactly what I was looking for (egzumer + messenger). As described in my other issue:

There seems to be an issue where reading eeprom with k5prog or chirp does not work. In CHIRP, it manifests as error

Header Short Read

It is not an issue with cable loose, because after receiving this error, I can flash egzumer firmware and read its eeprom in chirp all without touching the cable. And I have reproduced this many times.

I tried to debug why, but I was not able to figure it out. I have a feeling it has to do with

SerialConfigInProgress()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.