[Solved] Zero sensor values


#10

Okay, now I finally got it working. I had forgotten about the command:
sudo /usr/share/admobilize/matrix-creator/sam3-program.bash

After having gotten it to do readings, this command worked. So after it had programming the FPGA I rebooted just to be safe, then ran the sensors demo. It now showed zeros again. I tried rebooting again, still zeros. I tried the bash command again, but it just said it was already programmed. So I took the power from the Pi, took off the Matrix again, reconnected it again and connected the power again.

Now the readings are finally updating :slight_smile:

So, to try and sum up the other stuff I did, I ran a git pull in every folder. I guess the most important ones would be matrix-os and matrix-creator- hal. Then I ran:
sudo apt-get update
and
sudo apt-get upgrade
Then did a cmake and make in the matrix-creator-hal/build folder. Then bash again:
sudo /usr/share/admobilize/matrix-creator/sam3-program.bash
Then pulled power from the Pi, took off the Matrix. Waited 5-10 seconds as is usually a good idea when making sure a device has lost all power, put the Matrix back in the Pi, powered on and ran
./matrix-creator-hal/build/demos/sensors_demo
and the readings are updating. Hope this will help others save some time.


#11

I have tried every remedy in this thread multiple times, and sam3-program.bash still fails:

Open On-Chip Debugger 0.10.0-dev-00286-g83b68a2-dirty (2016-08-30-15:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
BCM2835 GPIO config: tck = 17, tms = 4, tdi = 22, tdo = 27
BCM2835 GPIO config: trst = 18
trst_only separate trst_push_pull
adapter speed: 512 kHz
Warn : em357.bs: nonstandard IR value
Warn : Specify TAP 'sam3n.cpu.cpu' by name, not number 3
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : JTAG only mode enabled (specify swclk and swdio gpio to add SWD mode)
Info : clock speed 512 kHz
Info : JTAG tap: em357.cpu tap/device found: 0x3ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x3)
Info : JTAG tap: em357.bs tap/device found: 0x069aa62b (mfg: 0x315 (Ember Corporation), part: 0x69aa, ver: 0x0)
Info : JTAG tap: xc6sxl4.fpga.fpga tap/device found: 0x24000093 (mfg: 0x049 (Xilinx), part: 0x4000, ver: 0x2)
Info : JTAG tap: sam3n.cpu.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Error: xc6sxl4.fpga.fpga: IR capture error; saw 0x35 not 0x11
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (6) in DAP response
Error: Failed to write memory at 0xe000201c
Error: Invalid ACK (6) in DAP response
Error: Failed to write memory at 0xe0002020
Info : sam3n.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: sam3n.cpu -- clearing lockup after double fault
Polling target sam3n.cpu failed, trying to reexamine
Error: Invalid ACK (6) in DAP response
Examination failed, GDB will be halted. Polling again in 100ms
Error: Invalid ACK (6) in DAP response
Polling target sam3n.cpu failed, trying to reexamine
Error: Invalid ACK (6) in DAP response
Error: Failed to write memory at 0xe000201c
Error: Invalid ACK (6) in DAP response
Error: Failed to write memory at 0xe000104c
Info : sam3n.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: Invalid ACK (6) in DAP response
Polling target sam3n.cpu failed, trying to reexamine
Error: Invalid ACK (6) in DAP response
Examination failed, GDB will be halted. Polling again in 100ms
Warn : target was in unknown state when halt was requested
Error: Invalid ACK (6) in DAP response

#12

Even everything in my last post? Because I not only had to try everything, it seemed I had to do it several times and finding the right order of doing it.


#13

Actually, looking closer at those errors, they look like RAM errors I think?


#14

I see similar errors in the log file when I run:
sudo /usr/share/admobilize/matrix-creator/sam3-program.bash
unexpected device ID codes coming back on JTAG?

Open On-Chip Debugger 0.10.0-dev-00286-g83b68a2-dirty (2016-08-30-15:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
BCM2835 GPIO config: tck = 17, tms = 4, tdi = 22, tdo = 27
BCM2835 GPIO config: trst = 18
trst_only separate trst_push_pull
adapter speed: 512 kHz
Warn : em357.bs: nonstandard IR value
Warn : Specify TAP 'sam3n.cpu.cpu' by name, not number 3
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : JTAG only mode enabled (specify swclk and swdio gpio to add SWD mode)
Info : clock speed 512 kHz
Info : JTAG tap: em357.cpu tap/device found: 0x3ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x3)
Info : JTAG tap: em357.bs tap/device found: 0x069aa62b (mfg: 0x315 (Ember Corporation), part: 0x69aa, ver: 0x0)
Info : JTAG tap: xc6sxl4.fpga.fpga tap/device found: 0x240000b3 (mfg: 0x059 (Performance Semi.), part: 0x4000, ver: 0x2)
Warn : JTAG tap: xc6sxl4.fpga.fpga       UNEXPECTED: 0x240000b3 (mfg: 0x059 (Performance Semi.), part: 0x4000, ver: 0x2)
Error: JTAG tap: xc6sxl4.fpga.fpga  expected 1 of 1: 0x24000093 (mfg: 0x049 (Xilinx), part: 0x4000, ver: 0x2)
Info : JTAG tap: sam3n.cpu.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Error: Trying to use configured scan chain anyway...
Error: xc6sxl4.fpga.fpga: IR capture error; saw 0x35 not 0x11
Warn : Bypassing JTAG setup events due to errors
Info : sam3n.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: sam3n.cpu -- clearing lockup after double fault
Polling target sam3n.cpu failed, trying to reexamine
Error: Invalid ACK (0) in DAP response
Examination failed, GDB will be halted. Polling again in 100ms
Polling target sam3n.cpu failed, trying to reexamine
Info : sam3n.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: Invalid ACK (6) in DAP response
Error: Failed to read memory at 0x400e0a0c
Error: Flash controller(0) is not ready, attempting reset
Error: Invalid ACK (6) in DAP response
Error: Failed to read memory at 0x00400008
Error: Flash controller(0) is not ready, attempting reset
Error: Invalid ACK (6) in DAP response
Error: Failed to read memory at 0x400e0438
Error: Cannot read SAM3 register: CKGR_MCFR @ 0x400e0424, Err: -107
Error: Cannot read SAM3 register: CKGR_MCFR @ 0x400e0424, Error: -107
Error: auto_probe failed

#15

Hi @analog71,

Are you having troubles getting data from the sensors? Can you show what tests have you donde so far?

Yoel


#16

Hi @yoelrc88

I just run the sensors demo program I got from here:

LED demos work (once I switch to a better supply for the rpi) but sensor demos only returning “0”. My MCU will not reflash same issues discussed here.


#17

@BobC did you ever figure out how to fix this?
Cheers
Anthony


#18

SOLVED?
At least two people still have this problem!


#19

@analog71 I got tired of messing with it. For now, I’m assuming it’s an unrecoverable hardware failure. I had hoped for better…


#20

Hi @BobC an others ,

Please check this announce Debian packages have been updated - MCU troubles.
Try this and let us know the results.

Yoel


#21

All seems good! At least the sensors demo now works for me.

Sorry for the delay. I physically broke (in two) the uSD card in my Pi3 when I accidentally pushed down on it while trying to remove the Matrix. Naturally, I had no backup and no spare uSD cards. Had to go shopping then reimage, reinstall and recreate everything.

We all know the moral to this story… Keep live backups! I now keep a thumbdrive in my Pi3, and run the following after any significant system change.

$ sudo mount /dev/sda1 /mnt && sudo dd if=/dev/mmcblk0 bs=1M | gzip /mnt/${HOSTNAME}.$(date +%s).img.gz && sudo umount /mnt


#22

Hi @BobC, great to hear that !

Hope @rkeithbeal, @analog71 and others users could test this too.


#23

@BobC @yoelrc88 sorry guys I’ve had no time to look at this for a while. Day job is keeping me too busy. Will try give it some time over the holidays.


#24

@yoelrc88 @BobC @rkeithbeal Got some time to play with this today. All working now or at least I can run the HAL demos provided. The “mic_demo” still returns “0” for me but the “mic_energy” demo seems to work fine in that the LEDs light up RED in response to sound. The “sensor_status” program returns the following:

IMUY:-1.6e+02° IMUR:-3.4° IMUP:-0.93°
HUMI:29% HTMP:34°C UVID:33
PRSS:1.0243e+05 PrAL:-91.75 PrTP:32.375
MCU :0x10 VER :0x161026

And the “sensor_demo” program:

yaw = -161.916° roll = -0.856716° pitch = -0.83855°

humidity = 28.3058 %
temperature (from humidity sensor) = 35.0635 °C

pressure = 102412 kPa
altitude = -90.25 meters
temperature (from altimeter) = 33.25 °C

UV = 22.0187

MCU ID = 0x10
MCU version = 0x161026

Leave it there for today. HW seems to be functioning. Now I need to figure out how to access the sensors from a Python program say on the RPI in order to use the HW for something :slight_smile:


#25

@BobC @yoelrc88 @rkeithbeal I guess I had to check the mics some more. I followed the instructions outlined here and it seems to work.

I converted one of the files to .WAV and played back. The recording is audible but I needed to max the ALSA PCM gain to 4dB. Also a fair amount of noise in the recording when I played back.


#26

sorry seems to be known issue with noise


#27

Hi @analog71,

Did you find how to get clear audio? In the post you mentioned the final conclusion is here : Noise in sound recording

The problem was malos running at the same time that the user app :

Let us know your progress con this !

Yoel


#28

Hi @yoelrc88
I haven’t tried yet. How do you kill this Malos process?
Can I remove this Malos and just use the low level drivers to directly access the HW via HAL?

There is a description here (Overview diagram seems to have been deleted?)

Cheers,
Anthony


#29

Yes @analog71, one valid option is just use HAL as a lower layer to access the data from the MATRIX Creator. As you said in that case you dont need MALOS or MOS. I recommend you to do a clean install from scratch just using HAL.

to kill malos you can try:
sudo pkill malos

Let us know is you have any problem with HAL

Yoel