kopia lustrzana https://github.com/cariboulabs/cariboulite
install - reduce buffers for rpizero
radio - mixer bugfixbug_fixes_integration_tx
rodzic
c42552dfff
commit
77d251e2a3
|
@ -18,12 +18,12 @@ install() {
|
|||
local mtu_mult=${1:-6}
|
||||
local dir_offs=${2:-2}
|
||||
local ch_offs=${3:-3}
|
||||
|
||||
|
||||
printf "${GREEN}Installation started...${NC}\n"
|
||||
printf "\n[ 1 ] ${GREEN}Updating kernel headers and needed software${NC}\n"
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install raspberrypi-kernel-headers module-assistant pkg-config libncurses5-dev cmake git
|
||||
|
||||
|
||||
printf "\n[ 2 ] ${GREEN}Compiling module${NC}\n"
|
||||
if [ -d "$BUILD_DIR" ]; then
|
||||
echo "Subdirectory '$BUILD_DIR' exists. Deleting its contents..."
|
||||
|
@ -32,21 +32,21 @@ install() {
|
|||
echo "Subdirectory '$BUILD_DIR' does not exist. Creating it..."
|
||||
mkdir "$BUILD_DIR"
|
||||
fi
|
||||
|
||||
|
||||
# enter build dir and build the ko file
|
||||
cd "${ROOT_DIR}/$BUILD_DIR"
|
||||
cmake ../
|
||||
make
|
||||
cd ${ROOT_DIR}
|
||||
|
||||
|
||||
# copy the outputs to internal software
|
||||
${BLOB_CREATOR_DIR}generate_bin_blob ${ROOT_DIR}/$BUILD_DIR/smi_stream_dev.ko smi_stream_dev ${USERSPACE_SMI_DIR}/smi_stream_dev_gen.h
|
||||
cp ${ROOT_DIR}/bcm2835_smi.h ${USERSPACE_SMI_DIR}
|
||||
cp ${ROOT_DIR}/smi_stream_dev.h ${USERSPACE_SMI_DIR}
|
||||
|
||||
|
||||
# find the location to install
|
||||
output_dir=$(find "/lib/modules" -type f -name "bcm2835_smi_dev*" -exec dirname {} \;)
|
||||
|
||||
|
||||
# Check if the output is empty
|
||||
if [ -z "$output_dir" ]; then
|
||||
printf "${RED}Error: module 'bcm2835_smi_dev' couldn't be found.${NC}\n"
|
||||
|
@ -54,26 +54,26 @@ install() {
|
|||
# suspicious - why doen't it exist? check of the base module bcm2835_smi exists
|
||||
exit 100
|
||||
fi
|
||||
|
||||
|
||||
printf "\n[ 3 ] ${GREEN}Installing into '${output_dir}'${NC}\n"
|
||||
xz -z ${ROOT_DIR}/$BUILD_DIR/smi_stream_dev.ko -c > ${ROOT_DIR}/$BUILD_DIR/smi_stream_dev.ko.xz
|
||||
sudo cp ${ROOT_DIR}/$BUILD_DIR/smi_stream_dev.ko.xz ${output_dir}/
|
||||
|
||||
|
||||
printf "\n[ 4 ] ${GREEN}Updating 'depmod'${NC}\n"
|
||||
sudo depmod -a
|
||||
|
||||
|
||||
printf "\n[ 5 ] ${GREEN}Blacklisting original bcm2835_smi_dev module${NC}\n"
|
||||
echo "# blacklist the broadcom default smi module to replace with smi_stream_dev" | sudo tee "/etc/modprobe.d/blacklist-bcm_smi.conf" > /dev/null
|
||||
echo "blacklist bcm2835_smi_dev" | sudo tee -a "/etc/modprobe.d/blacklist-bcm_smi.conf" > /dev/null
|
||||
|
||||
|
||||
printf "\n[ 6 ] ${GREEN}Adding systemd configuration${NC}\n"
|
||||
echo "# load SMI stream driver on startup" | sudo tee "/etc/modules-load.d/smi_stream_mod.conf" > /dev/null
|
||||
echo "smi_stream_dev" | sudo tee -a "/etc/modules-load.d/smi_stream_mod.conf" > /dev/null
|
||||
|
||||
|
||||
printf "\n[ 7 ] ${GREEN}Adding modprobe configuration ${mtu_mult}, ${dir_offs}, ${ch_offs}${NC}\n"
|
||||
echo "# SMI STREAM DEV specific options" | sudo tee "/etc/modprobe.d/smi_stream_mod_cariboulite.conf" > /dev/null
|
||||
echo "options smi_stream_dev fifo_mtu_multiplier=${mtu_mult} addr_dir_offset=${dir_offs} addr_ch_offset=${ch_offs}" | sudo tee -a "/etc/modprobe.d/smi_stream_mod_cariboulite.conf" > /dev/null
|
||||
|
||||
|
||||
printf "\n[ 8 ] ${GREEN}Adding UDEV rules${NC}\n"
|
||||
cd ${ROOT_DIR}/udev
|
||||
sudo ./install.sh install
|
||||
|
|
|
@ -114,7 +114,7 @@ kernel_memory_mb=$((kernel_memory / 1024))
|
|||
if (( kernel_memory_mb > 512 )); then
|
||||
./install.sh install 6 2 3
|
||||
else
|
||||
./install.sh install 3 2 3
|
||||
./install.sh install 2 2 3
|
||||
fi
|
||||
cd ..
|
||||
|
||||
|
|
|
@ -17,14 +17,14 @@ extern "C" {
|
|||
|
||||
/*
|
||||
* Time tagging of the module through the 'struct tm' structure
|
||||
* Date: 2023-06-06
|
||||
* Time: 08:16:17
|
||||
* Date: 2023-06-07
|
||||
* Time: 05:58:36
|
||||
*/
|
||||
struct tm smi_stream_dev_date_time = {
|
||||
.tm_sec = 17,
|
||||
.tm_min = 16,
|
||||
.tm_hour = 8,
|
||||
.tm_mday = 6,
|
||||
.tm_sec = 36,
|
||||
.tm_min = 58,
|
||||
.tm_hour = 5,
|
||||
.tm_mday = 7,
|
||||
.tm_mon = 5, /* +1 */
|
||||
.tm_year = 123, /* +1900 */
|
||||
};
|
||||
|
|
|
@ -72,13 +72,11 @@ int cariboulite_radio_ext_ref ( sys_st *sys, cariboulite_ext_ref_freq_en ref)
|
|||
ZF_LOGD("Setting ext_ref = 26MHz");
|
||||
at86rf215_set_clock_output(&sys->modem, at86rf215_drive_current_8ma, at86rf215_clock_out_freq_26mhz);
|
||||
rffc507x_setup_reference_freq(&sys->mixer, 26e6);
|
||||
rffc507x_calibrate(&sys->mixer);
|
||||
break;
|
||||
case cariboulite_ext_ref_32mhz:
|
||||
ZF_LOGD("Setting ext_ref = 32MHz");
|
||||
at86rf215_set_clock_output(&sys->modem, at86rf215_drive_current_8ma, at86rf215_clock_out_freq_32mhz);
|
||||
rffc507x_setup_reference_freq(&sys->mixer, 32e6);
|
||||
rffc507x_calibrate(&sys->mixer);
|
||||
break;
|
||||
case cariboulite_ext_ref_off:
|
||||
ZF_LOGD("Setting ext_ref = OFF");
|
||||
|
@ -668,6 +666,7 @@ int cariboulite_radio_set_frequency(cariboulite_radio_state_st* radio,
|
|||
if (f_rf_mod_26 > 13e6) f_rf_mod_26 = 26e6 - f_rf_mod_26;
|
||||
ext_ref_choice = f_rf_mod_32 > f_rf_mod_26 ? cariboulite_ext_ref_32mhz : cariboulite_ext_ref_26mhz;
|
||||
cariboulite_radio_ext_ref (radio->sys, ext_ref_choice);
|
||||
rffc507x_calibrate(&radio->sys->mixer);
|
||||
|
||||
// Decide the conversion direction and IF/RF/LO
|
||||
//-------------------------------------
|
||||
|
@ -1035,4 +1034,4 @@ int cariboulite_radio_write_samples(cariboulite_radio_state_st* radio,
|
|||
size_t cariboulite_radio_get_native_mtu_size_samples(cariboulite_radio_state_st* radio)
|
||||
{
|
||||
return caribou_smi_get_native_batch_samples(&radio->sys->smi);
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue