azinke / mmwave

Linux tool for controlling the MMWCAS-DSP-EVM and MMWAVECAS-RF-EVM boards
MIT License
25 stars 5 forks source link

"TDA Armin failed!" when just recording #2

Open chuber1986 opened 1 year ago

chuber1986 commented 1 year ago

When performing configuration and recording in one step everything works fine

$ ./mmwave --capture-dir testdir1 --configure --record
STARTSTATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS    0 | DEV MAP:  1 | [MASTER] RF successfully enabled!
STATUS    0 | DEV MAP:  1 | [MASTER] Channels successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] ADC output format successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] Init completed with sucess

STATUS    0 | DEV MAP:  2 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  4 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  8 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP: 14 | [SLAVE] Firmware successfully uploaded!
STATUS    0 | DEV MAP: 14 | [SLAVE] CRC type has been set!
STATUS    0 | DEV MAP: 14 | [SLAVE] RF successfully enabled!
STATUS    0 | DEV MAP: 14 | [SLAVE] Channels successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] ADC output format successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] Init completed with sucess

STATUS    0 | DEV MAP: 15 | [ALL] RF deivce configured!
STATUS    0 | DEV MAP: 15 | [ALL] LDO Bypass configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Data format configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Low Power Mode configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] RF successfully initialized!
STATUS    0 | DEV MAP: 15 | [ALL] Datapath configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Profile configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Chirp configuration successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Frame configuration completed!
STATUS    0 | DEV MAP: 14 | [SLAVE] Frame configuration completed!
STATUS    0 | DEV MAP: 15 | [MIMO] Configuration completed!

STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] Arming TDA
STATUS    0 | DEV MAP: 15 | [MMWCAS-RF] Framing ...
STATUS    0 | DEV MAP: 32 | [MMWCAS-RF] Stop recording

When I'm just recording (directly after the command above) I get the following error message:

$ ./mmwave --capture-dir testdir2 --record
STARTSTATUS   -8 | DEV MAP: 32 | [MMWCAS-DSP] TDA Arming failed!

Same thing happen when I do the configuration only and then try to record a frame:

./mmwave --configure
STARTSTATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS    0 | DEV MAP:  1 | [MASTER] RF successfully enabled!
STATUS    0 | DEV MAP:  1 | [MASTER] Channels successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] ADC output format successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] Init completed with sucess

STATUS    0 | DEV MAP:  2 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  4 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  8 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP: 14 | [SLAVE] Firmware successfully uploaded!
STATUS    0 | DEV MAP: 14 | [SLAVE] CRC type has been set!
STATUS    0 | DEV MAP: 14 | [SLAVE] RF successfully enabled!
STATUS    0 | DEV MAP: 14 | [SLAVE] Channels successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] ADC output format successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] Init completed with sucess

STATUS    0 | DEV MAP: 15 | [ALL] RF deivce configured!
STATUS    0 | DEV MAP: 15 | [ALL] LDO Bypass configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Data format configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Low Power Mode configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] RF successfully initialized!
STATUS    0 | DEV MAP: 15 | [ALL] Datapath configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Profile configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Chirp configuration successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Frame configuration completed!
STATUS    0 | DEV MAP: 14 | [SLAVE] Frame configuration completed!
STATUS    0 | DEV MAP: 15 | [MIMO] Configuration completed!

$ ./mmwave --capture-dir testdir2 --record
STARTSTATUS   -8 | DEV MAP: 32 | [MMWCAS-DSP] TDA Arming failed!

Do you have any hint what the problem is there?

BR Christian

azinke commented 1 year ago

Hi @chuber1986 , Indeed, using the options --configure and --record separately does not work as expected. My initial guess would be that the MMWL_ArmingTDA function is failing either because of a closed connection with the board or "still in use". Not sure what's the cause yet.

I could investigate this a little further. Do you mind testing when I ready a branch for this?!

I've developed this with the hardware of the university but I've finished my studies already. I'm planning to acquire a board myself but, for now, I couldn't directly implement and test bug fixes or new features

chuber1986 commented 1 year ago

Hi @azinke,

sure, I can test that! :) Just let me know then the branch is ready.

BR Christian

chuber1986 commented 1 year ago

Hi @azinke !

Sorry, for the late answer. In this commit are 2 errors:

  1. In int MMWL_ConfigureDeviveMap(unsigned char deviceMap) {} you return retVal once which is not define. This should be status, I guess. For consistency I'd rename status to retVal.
  2. In int MMWL_ConfigureDeviveMap(unsigned char deviceMap) {} the timeOutCnt valiable was not defined.

After fixing these it again compiles, but unfortunately it doesn't fix the issue. I still get $ ./mmwave record --capture-dir testdir2 STATUS 0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected! STATUS -8 | DEV MAP: 32 | [MMWCAS-DSP] TDA Arming failed!

BR Christian

azinke commented 10 months ago

Hi @chuber1986 !

Thank you very much for the feedback and sorry for the late response. It also took me some time to spot the issue with the "arming" without the board. But I also received helpful debugging logs to investigate this issue.

I've added a new commit to the Pull Request. Could you please test it and let me know of the outcome?! Thanks!

chuber1986 commented 10 months ago

Hi @azinke!

Unfortunately, I still get the same error:

> ./mmwave --help
usage: mmwave [command] [option]

Configuration and control tool for TI MMWave Evaluation Modules

Arguments:
    configure                      Configure the MMWCAS-RF-EVM board
    record                         Trigger data recording. This assumes that configuration is completed.
      -d,  --capture-dir           Name of the director where to store recordings on the DSP board
      -p,  --port                  Port number the DSP board server app is listening on
      -i,  --ip                    IP Address of the MMWCAS DSP evaluation module
      -t,  --time                  Indicate how long the recording should last in minutes. Default: 1 min
      -f,  --cfg                   TOML Configuration file. Overwrite the default config when provided
      -h,  --help                  Print CLI option help and exit.
      -v,  --version               Print program version and exit.

> ./mmwave --version
mmwave 0.1, Copyright (C) 2022 - 2023

> ./mmwave configure
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP: 15 | [MMWCAS-DSP] TDA Initialized!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS   -8 | DEV MAP:  1 | [MASTER] Error: Failed to enable master RF

> ./mmwave configure -f config/short-range-cfg.toml
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP: 15 | [MMWCAS-DSP] TDA Initialized!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS   -8 | DEV MAP:  1 | [MASTER] Error: Failed to enable master RF

> ./mmwave configure -f config/very-short-range-cfg.toml
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP: 15 | [MMWCAS-DSP] TDA Initialized!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS    0 | DEV MAP:  1 | [MASTER] RF successfully enabled!
STATUS    0 | DEV MAP:  1 | [MASTER] Channels successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] ADC output format successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] Init completed with sucess

STATUS    0 | DEV MAP:  2 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  4 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  8 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP: 14 | [SLAVE] Firmware successfully uploaded!
STATUS    0 | DEV MAP: 14 | [SLAVE] CRC type has been set!
STATUS    0 | DEV MAP: 14 | [SLAVE] RF successfully enabled!
STATUS    0 | DEV MAP: 14 | [SLAVE] Channels successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] ADC output format successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] Init completed with sucess

STATUS    0 | DEV MAP: 15 | [ALL] RF deivce configured!
STATUS    0 | DEV MAP: 15 | [ALL] LDO Bypass configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Data format configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Low Power Mode configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] RF successfully initialized!
STATUS    0 | DEV MAP: 15 | [ALL] Datapath configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Profile configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Chirp configuration successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Frame configuration completed!
STATUS    0 | DEV MAP: 14 | [SLAVE] Frame configuration completed!
STATUS    0 | DEV MAP: 15 | [MIMO] Configuration completed!

STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA successfully disconnected!

> ./mmwave record
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS   -8 | DEV MAP: 32 | [MMWCAS-DSP] TDA Arming failed!
azinke commented 10 months ago

Hi @chuber1986 ! Have you maybe forgotten to fetch the new update before building the source? In the latest update, I've moved the "Frame Configuration" steps in the record command. And it seems to be appearing in configure in the logs. I mean, these lines

STATUS    0 | DEV MAP:  1 | [MASTER] Frame configuration completed!
STATUS    0 | DEV MAP: 14 | [SLAVE] Frame configuration completed!

With a custom configuration file, the commands would be as follows:

# Prepare the DSP board for recording
./mmwave configure -f config/short-range-cfg.toml

# Trigger recording
./mmwave record -f config/short-range-cfg.toml

But it's also possible to use the default config

# Prepare the DSP board for recording
./mmwave configure

# Trigger recording
./mmwave record
chuber1986 commented 10 months ago

Morning @azinke ,

you are right. It seams that my git-pull failed without me recognizing it. Now I get:

> ./mmwave configure -f config/v
ery-short-range-cfg.toml
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS    0 | DEV MAP: 15 | [MMWCAS-DSP] TDA Initialized!
STATUS    0 | DEV MAP:  1 | [MASTER] Power up successful!
STATUS    0 | DEV MAP:  1 | [MASTER] Firmware successfully uploaded!
STATUS    0 | DEV MAP:  1 | [MASTER] CRC type has been set!
STATUS    0 | DEV MAP:  1 | [MASTER] RF successfully enabled!
STATUS    0 | DEV MAP:  1 | [MASTER] Channels successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] ADC output format successfully configured!
STATUS    0 | DEV MAP:  1 | [MASTER] Init completed with sucess

STATUS    0 | DEV MAP:  2 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  4 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP:  8 | [SLAVE] Power up successful!
STATUS    0 | DEV MAP: 14 | [SLAVE] Firmware successfully uploaded!
STATUS    0 | DEV MAP: 14 | [SLAVE] CRC type has been set!
STATUS    0 | DEV MAP: 14 | [SLAVE] RF successfully enabled!
STATUS    0 | DEV MAP: 14 | [SLAVE] Channels successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] ADC output format successfully configured!
STATUS    0 | DEV MAP: 14 | [SLAVE] Init completed with sucess

STATUS    0 | DEV MAP: 15 | [ALL] RF deivce configured!
STATUS    0 | DEV MAP: 15 | [ALL] LDO Bypass configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Data format configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Low Power Mode configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] RF successfully initialized!
STATUS    0 | DEV MAP: 15 | [ALL] Datapath configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Profile configuration successful!
STATUS    0 | DEV MAP: 15 | [ALL] Chirp configuration successful!
STATUS    0 | DEV MAP: 15 | [MIMO] Configuration completed!

STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA successfully disconnected!

> ./mmwave record -f config/very-short-range-cfg.toml
STATUS    0 | DEV MAP: 32 | [MMWCAS-DSP] TDA Connected!
STATUS   -2 | DEV MAP:  1 | [MASTER] Frame configuration failed!

I tried to do the PowerUp before recording (right after connecting to the TDA), but the same error occurs. Any ideas?

azinke commented 10 months ago

Could you provide a log with debugging enabled?! It would allow us to spot where exactly the issue is coming from

# define DEBUG 1
chuber1986 commented 10 months ago

The full debug output from the configuration: conf_log.txt

and from the recording: rec_log.txt

BR, Christian