Go to advanced search

by rzusman
Thu Oct 11, 2018 12:59 am
Forum: C/C++
Topic: Valgrind
Replies: 21
Views: 542

Re: Valgrind

Thanks for the suggestions.
The code is quite complicated - it’s a scheduler for controlling industrial lighting, and it communicates via RS-485 and cellular modems. Maybe 20,000 lines of C.

Anyway, I’ll spend some time trying to figure out what is slowing down valgrind so much when I get a chance.
by rzusman
Sat Oct 06, 2018 3:17 pm
Forum: C/C++
Topic: Valgrind
Replies: 21
Views: 542

Re: Valgrind

I'm testing this on the Compute Module 3 lite.
by rzusman
Fri Oct 05, 2018 9:43 pm
Forum: C/C++
Topic: Valgrind
Replies: 21
Views: 542

Re: Valgrind

OK, so I upgraded from 3.7 to 3.13 (apt-get installs 3.7), and that stopped all the bazillion errors before main().
It's still really slow, but I can figure out how to deal with that.
by rzusman
Fri Oct 05, 2018 2:49 pm
Forum: C/C++
Topic: Valgrind
Replies: 21
Views: 542

Re: Valgrind

I'll look at some of the suggestions later, but as an example, valgrind is emitting thousands of errors like this: ==857== 2 errors in context 110 of 270: ==857== Use of uninitialised value of size 4 ==857== at 0x401AB20: memcpy (memcpy.S:339) ==857== by 0x400BBE7: _dl_new_object (dl-object.c:87) ==...
by rzusman
Fri Oct 05, 2018 12:25 am
Forum: C/C++
Topic: Read UART Packet
Replies: 5
Views: 229

Re: Read UART Packet

Your code is going to read bytes as they are sent. So, what you should see is something like: 41 No data on port No data on port No data on port be No data on port No data on port No data on port No data on port No data on port 2 No data on port No data on port No data on port No data on port No dat...
by rzusman
Thu Oct 04, 2018 10:48 pm
Forum: C/C++
Topic: Valgrind
Replies: 21
Views: 542

Valgrind

Based on a hint from a recent thread, I installed valgrind and ran it on my software. It found thousands of "Use of uninitialised value" errors - even before my software ran! Seems like the GCC pre-main code is full of "iffy" code. Anyway, it also found a whole bunch of these in my main function, ev...
by rzusman
Wed Oct 03, 2018 7:52 pm
Forum: Compute Module
Topic: CM3 get more GPIO
Replies: 3
Views: 169

Re: CM3 get more GPIO

What are these digital inputs?
Can they be scanned as a matrix?
by rzusman
Wed Oct 03, 2018 3:47 am
Forum: Bare metal, Assembly language
Topic: Segmentation Faults
Replies: 4
Views: 241

Re: Segmentation Faults

This is what's know as a "Heisenbug." They are mostly caused by writing past the end of an array, somewhere else in the program, or writing through an incorrect pointer (at least in C - I dunno about forth). Depending on where the array is (on the stack, for instance), writing past the end of it wil...
by rzusman
Wed Oct 03, 2018 12:57 am
Forum: Advanced users
Topic: Next step after using the pi is...?
Replies: 16
Views: 565

Re: Next step after using the pi is...?

You’re wasting your time.
How many units are you planning on selling? 1, 10, 100, 1,000,000?
If you are selling small numbers, it’s not a big enough market for someone to crack your code.
If you are selling huge numbers, then it’s worth the hacker’s time to crack any encryption method you use.
by rzusman
Sat Sep 29, 2018 9:04 pm
Forum: Advanced users
Topic: Compress SD card for Compute Module lite
Replies: 5
Views: 214

Re: Compress SD card for Compute Module lite

I tried the PiShrink script, and it failed with some "Superblock" issue, even though the SD card boots just fine. I'll fsck it manually, and try again. I found another script (from a Korean programmer), and that one failed, also. This really shouldn't be that difficult. I like W.H.H.'s suggestion - ...
by rzusman
Sat Sep 29, 2018 12:38 am
Forum: Advanced users
Topic: Compress SD card for Compute Module lite
Replies: 5
Views: 214

Re: Compress SD card for Compute Module lite

Maybe.
I'll give it a try.
It would be nice to find something that just "optimizes" the layout on the SD, though.
by rzusman
Fri Sep 28, 2018 6:18 pm
Forum: Advanced users
Topic: Compress SD card for Compute Module lite
Replies: 5
Views: 214

Compress SD card for Compute Module lite

I have my first beta image for our Compute Module-based controller. I would like to take this image and compress it so that when I need to duplicate it (using dd), I only have to copy the first N in-use blocks, and not 7GB of unused blocks. I have seen hints on the web on how to do this, but most of...
by rzusman
Fri Sep 28, 2018 6:14 pm
Forum: Advanced users
Topic: Pi to relays for sprinklers and lights
Replies: 6
Views: 232

Re: Pi to relays for sprinklers and lights

You need to watch the Pi and see if it fails when the solenoids switch.
Did the Pi get killed, or was it just hung?
by rzusman
Sat May 26, 2018 9:27 pm
Forum: Compute Module
Topic: Can CM3L be used as the same way as original pi?
Replies: 7
Views: 669

Re: Can CM3L be used as the same way as original pi?

It really depends on the volume.
A CM-based system also allows you to tailor the carrier board to the exact shape needed, and add any special interfaces.
by rzusman
Sat May 26, 2018 2:59 am
Forum: Compute Module
Topic: Can CM3L be used as the same way as original pi?
Replies: 7
Views: 669

Re: Can CM3L be used as the same way as original pi?

I don’t see any reason why not.
by rzusman
Wed Mar 07, 2018 11:48 pm
Forum: Compute Module
Topic: CM3 console [Solved]
Replies: 5
Views: 1264

Re: CM3 console

Is the CM3 booting?
Can you see the activity light flashing?
by rzusman
Sun Dec 17, 2017 5:51 pm
Forum: Compute Module
Topic: [SOLVED] eMMC not mounting after rpiboot
Replies: 6
Views: 1364

Re: eMMC not mounting after rpiboot

What machine are you using as a host?
by rzusman
Fri Dec 15, 2017 5:42 pm
Forum: Compute Module
Topic: SD card license for 4-bit SD mode
Replies: 4
Views: 815

Re: SD card license for 4-bit SD mode

OK, then why not just use SPI? Is your data rate that fast?
by rzusman
Fri Dec 15, 2017 12:53 pm
Forum: Compute Module
Topic: SD card license for 4-bit SD mode
Replies: 4
Views: 815

Re: SD card license for 4-bit SD mode

I'd like to know how you plan on booting the 2nd CM3L module.

Or, do you mean each CM3L module will have two SD cards?
by rzusman
Sat Dec 09, 2017 10:45 pm
Forum: Compute Module
Topic: EMMC_EN_N to drive LED
Replies: 1
Views: 446

Re: EMMC_EN_N to drive LED

You can use EMMC_EN_N to flash an activity LED, but you should probably drive the LED with a low-threshold FET, like SSM3K329RLFCT-ND (from DigiKey).
This is what I do, and it works fine.
by rzusman
Wed Nov 29, 2017 3:54 am
Forum: Compute Module
Topic: Kernel Crash with GSM Modem AND I2C-0 Enabled
Replies: 3
Views: 760

Re: Kernel Crash with GSM Modem AND I2C-0 Enabled

Check your power supply!
by rzusman
Sun Nov 19, 2017 1:19 pm
Forum: Compute Module
Topic: USB error in custom IO board
Replies: 10
Views: 1391

Re: USB error in custom IO board

Actually, I meant to write 10µF
by rzusman
Sat Nov 18, 2017 3:48 am
Forum: Compute Module
Topic: USB error in custom IO board
Replies: 10
Views: 1391

Re: USB error in custom IO board

OK. The D± traces should really be balanced and 90Ω, and that may be causing your problem, but I also notice that you don’t have any visible bypass and bulk decoupling capacitors next to the USB connector. They are important, especially for devices that have sudden high-current draw. Try soldering a...
by rzusman
Fri Nov 17, 2017 11:07 pm
Forum: Compute Module
Topic: USB error in custom IO board
Replies: 10
Views: 1391

Re: USB error in custom IO board

Post a detail of the layout from the CM socket to the USB connector, please.
by rzusman
Fri Nov 10, 2017 11:19 pm
Forum: Compute Module
Topic: Minimum Input high voltage (VIH) for 3,3V GPIO Supply
Replies: 5
Views: 1049

Re: Minimum Input high voltage (VIH) for 3,3V GPIO Supply

Surprisingly, this value doesn’t seem to be published anywhere. But, these guys estimate it to be 2.1-2.3v: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications Still, you should not be pushing the spec. If you are using logic lev...

Go to advanced search