44 Commits

Author SHA1 Message Date
Sergey Kostanbaev
88e0f1c156 zpu: check that enough memory is available for the image to operate.
This is a fixup commit for the previous commit (8D7B9D84).

ZPU is a stack machine where all code, constants, variables and function stack
are stored in a single memory block. Compiler doesn't through any warnings
or errors if the allocated memory is exhausted, so we have to check this
manually.

Our memory size is only 16383 bytes and we already had situation when all of it
is exhausted leading to unpredictable behaviour. Unfortunately we can't know
how much memory exactly do we need, but we estimated that 1300 bytes is enough
for us now, so this is what we're checking.
2017-08-04 15:41:54 +03:00
Sergey Kostanbaev
8d7b9d84ed zpu: check that minimal stack is available 2017-08-02 13:49:55 +03:00
Sergey Kostanbaev
7588631788 zpu: increase UART lucky number 2017-08-02 12:59:10 +03:00
Sergey Kostanbaev
c5479d66b3 zpu: reduce UART buffer in bootloader mode 2017-08-02 12:58:37 +03:00
Sergey Kostanbaev
5bc5265fd7 zpu: hide some debug messages in bootloader mode 2017-08-02 12:55:46 +03:00
Sergey Kostanbaev
dd16447884 zpu: use define for PID coeffs, save extra space 2017-08-02 12:51:38 +03:00
Sergey Kostanbaev
76f0a92574 zpu: short messages in bootloader to save space 2017-08-02 12:44:15 +03:00
Sergey Kostanbaev
6731023b5c zpu: currently we have only 2 NOPs in the firmware 2017-08-02 12:41:21 +03:00
Sergey Kostanbaev
79938f6090 zpu: allocate only data for UARTs we're interested
Currently we allocate data even for UARTS we're not listening
2017-08-02 12:36:10 +03:00
Sergey Kostanbaev
868f511f0d zpu: add Init done message before main loop 2017-08-02 12:17:48 +03:00
Sergey Kostanbaev
825a076c5c zpu: make statup messages more compact 2017-08-02 12:17:14 +03:00
Sergey Kostanbaev
fc5067d9c1 zpu: get rid of printf format warning 2017-08-02 12:15:36 +03:00
Sergey Kostanbaev
5483f698f3 zpu: make log2_sector_size constant 2017-08-02 12:14:45 +03:00
Alexander Chemeris
cb44fdb112 zpu: Slightly better debug output for GPSDO. 2017-07-31 00:32:12 +03:00
Alexander Chemeris
842e31803f zpu: Optimize GPSDO behavior when setting frequency manually or from EEPROM.
It'c not critical for production use, because it onlu affect time to lock
on startup or on manual frequency correction, but it makes lock faster
when in testing environment, e.g. in out post-manufacturing testing.
2017-07-31 00:27:38 +03:00
Alexander Chemeris
8cef0f4c6c zpu: Init TCXO DAC from EEPROM on firmware start and reset GPSDO LPF when setting DAC.
We will then disable forced TCXO DAC setting by UHD host library. This way we
avoid de-calibration on every UHD restart in case of operational GPSDO.

Setting GPSDO LPF to the current calculated frequency after setting the DAC
maually should help GPSDO to converge faster. Right now it starts really slow,
because it starts from a perfect target value.
2017-07-28 21:27:14 +03:00
Alexander Chemeris
96ac532510 zpu: Add functions to read/write TCXO DAC calibration from EEPROM. 2017-07-28 21:25:16 +03:00
Alexander Chemeris
a4afe97d54 zpu: Make debug output on wrong packets less scary.
Users think that these messages indicate some sort of an issue, but
they are part of a normal UHD startup process. So we make them look
rather informational and less scary.
2017-07-27 13:38:54 +03:00
Alexander Chemeris
f4f02a51c0 zpu: Get basi GPSDO information and en/dis debug over the control socket. 2017-07-27 01:18:28 +03:00
Alexander Chemeris
907c28f849 zpu: Print firmware minor version and git hash on bootup. 2017-07-27 01:14:25 +03:00
Alexander Chemeris
dfa6aa0a0c zpu: Reset PID when setting TCXO DAC from the control socket. 2017-07-26 23:20:36 +03:00
Alexander Chemeris
aa35f5cc40 zpu: Make GPSDO debug runtime configurable, add more of it. 2017-07-26 22:39:12 +03:00
Alexander Chemeris
dfc98a6900 zpu: More precision for GPSDO.
Now we really get to +-1 Hz of the base TCXO frequency precision.

Previously we ignored least significant bits of the frequency due to integer
arithmetics rounding, which meant that we could get up to about 80 ppb of
static frequency error which is not good enough for telco systems.
2017-07-26 22:03:20 +03:00
Alexander Chemeris
7e351e3465 zpu: dac_value is only used in this file. 2017-07-26 22:00:38 +03:00
Alexander Chemeris
6ded41c3fd zpu: Don't confuse users telling USRP2 is loading - it's UmTRX they have! 2015-04-26 23:19:22 -04:00
Alexander Chemeris
fd2493f8fe zpu: Do not attempt to load production ZPU firmware from safe FPGA image.
This is almost always a bad idea and can lead to weird issues if you have produciton
ZPU firmware which is incompatible with your safe FPGA image.
2015-04-26 23:09:47 -04:00
Josh Blum
12e613bec2 umtrx: store 4 byte git hash into fw 2015-04-07 21:34:38 -07:00
Josh Blum
ca17c9da65 zpu: move spi mask into spi.c 2015-03-24 01:00:05 -07:00
Josh Blum
35522afed1 zpu: fixed umtrx_init() lms_res typo 2015-03-24 00:28:42 -07:00
Sergey Kostanbaev
20178f16fd zpu: add watchdog timer for while( ... ); operations 2015-03-12 20:57:38 +03:00
Sergey Kostanbaev
6129113723 zpu: set UART debug port speed 115200 2015-03-12 20:37:07 +03:00
Josh Blum
197e2f01f9 umtrx: added net reset for fw/fpga boot 2014-10-27 20:21:26 -04:00
Josh Blum
2b79a428c0 umtrx: updated fw memory map for register remap 2014-10-27 09:50:16 -04:00
Alexey Shamrin
66bd29ecbc umtrx: fix GPS NMEA data, over UART1 (UDP/49171)
ZPU firmware was setup to poll uart2 (== UDP port 47172) on the quad_uart.v
core. And uart2 is connected to RXD[3] and TXD[3] in the top level. However,
the GPS UART lines are connected to RXD[2] and TXD[2] in the UCF -- which
would be UART1 in from the quad_uart.v/firmware's perspective.

This fix makes ZPU firmware use uart1 (UDP/49171) instead of uart2.

(The other alternative was to change this assignment in FPGA firmware:
https://github.com/fairwaves/UHD-Fairwaves/blob/4fa97a15a241/fpga/usrp2/top/N2x0/u2plus_umtrx_v2.v#L631)

Quick way to see GPS NMEA data (GPS antenna should be connected and GPS
LED should blink once a second):

    echo hello | nc -u 192.168.10.2 49171

Huge kudos to @guruofquality for debugging this problem.
2014-07-09 19:52:51 +04:00
Josh Blum
bee6934762 umtrx: switch to timed spi core 2014-04-20 23:37:57 -07:00
Josh Blum
9eec2fc117 umtrx: missed a file from last commit 2014-04-20 11:15:05 -07:00
Josh Blum
a7d5cac2c9 umtrx: resets and clears when IMCP disconnect -- UDP dest not reachable 2014-04-20 10:56:12 -07:00
Josh Blum
565ced2732 umtrx: lms reset gets its own register 2014-04-19 16:35:42 -07:00
Josh Blum
d660c361ed umtrx: protoframer gets dedicted settings bus 2014-04-19 10:41:44 -07:00
Josh Blum
4620ad044c umtrx: work in settings fifo integration 2014-04-18 22:52:01 -07:00
Josh Blum
e816a55ee2 umtrx: work on wider router and dispatcher + fw changes to match -- not tested 2014-04-18 18:41:23 -07:00
Josh Blum
5a34f6b1a2 umtrx: work on program stream dest 2014-04-15 23:08:39 -07:00
Josh Blum
3d692278a9 umtrx: firmware building in current directory structure 2014-04-07 17:39:31 -07:00
Josh Blum
505b677c7a umtrx: moved new umtrx directory up one 2014-04-07 17:34:55 -07:00