strong_silent_t

Joined 9 years ago

Karma
243
Submissions
38
Member since
Oct 28
View on Hacker News

Recent submissions

Comment · 8 years ago
Comment · 8 years ago
Comment · 8 years ago
Not sure, I haven't used that platform personally, there is probably a debugging interface to the chip but it will probably require different hardware/software.
Comment · 8 years ago
This is similar to what I did: https://learn.adafruit.com/proper-step-debugging-atsamd21-ar... . That is for that specific platform, not sure if there is something similar for the other versions.

I used the J-Link but I wanted to do it on Linux, so I used the JLink GDB Server along with the GDB build that comes with the Arduino IDE. It probably takes me a good 5 minutes to get everything set up, but the basic stuff works: breakpoints, stack trace, reading and writing memory locations.

The setup is a little convoluted, I'm not sure if there is a better way, but here are my notes:

    Procedure for running w/ debugger attached.
    
    1. disconnect debugger's usb
    2. connect device via usb
    3. arduino IDE program device
    4. identify elf, set up gdb with elf.
    5. plug in debugger
    6. run jlink gdb server
    7. attach gdb to jlink server "target remote:2331"
    8. "monitor reset", "continue" to re-run target from beginning.
    9. observe device is recognized by Arduino IDE
    10. open Arduino IDE serial monitor to interact with device.
    
    Now, Ctrl+C in GDB halts device, and stack etc. can be inspected, and
    then it can continue running with "cont".
    
    To rerun the device with the same program without redoing everything,
    go to step 8 and reset the device. and continue from there.
    
    To find .elf on linux:
    ==================================================
    find /tmp -name sketch_name.ino.elf 2>/dev/null
    

    gdb location:
    ==================================================
    /home/user/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gdb
    
    
    JLink setup command:
    ==================================================
    JLinkGDBServer -device ATSAMD21G18A -if SWD -speed 4000
    

    gdb attachment:
    ==================================================
    (gdb) target remote:2331
Comment · 8 years ago
I find it depends a lot on my level of understanding of the project I'm working on. If I wrote 20% or more of the code, or if I was involved in the design, etc., when there is a problem I know just where to look and can get there quickly.

For example, if I'm working on a Python script under 1000 lines I would never use a debugger. I might use wireshark or linux system tools if something was really wrong, but usually the trackback or program output is sufficient.

I've also tried to debug an Arduino project where I had a lot less knowledge of how the system works, and if I wasn't able to attach a debugger I don't want to know how long it would have taken me to find the problem (calling a null function pointer causes an interrupt that didn't have any handler).

I've also tried to debug other people's projects in high level languages, without a debugger where after taking about an hour to figure it out based on pure reason, realizing it would have been very quick and easy to find with a debugger.

I think if you look at what a program is doing, and at that point you can't form a testable hypothesis as to what is happening, at that point a debugger will certainly be faster if you know how to use it.

Comment · 8 years ago
I think if the government is going to subsidize something, politically aerospace makes a lot of sense. It has jobs for engineering, technicians, and high-skill trades. It has a long planning horizon and lots of regulation (meaning less short term competitive forces at play). It has defense applications. The downside is that everyone else is also subsidizing it, so it is still hard to compete.
Comment · 8 years ago
Every zero-sum adversarial system would be a lot more efficient if they accepted the judgement of a third party instead. How much energy could we save if we dismantled the court system, elections, and pro sports?

I think DAG coins could be a lot more efficient, but I'm not totally solid intellectually on how they achieve consensus on conflicting spends so I'm not sure it will work as a general solution. The only one I've used, nano, has I believe no mining reward, and I think consensus is achieved based on a voting process weighted by proof-of-stake among online nodes -- the incentive for participating in the system is that the system has value for you in other ways. I'm not closely following ETH PoS research, but it will be interesting to see what they can accomplish, it could create a huge reduction in energy consumption.

Comment · 8 years ago
I'd be really interested if anyone has a book or similar on supply and demand curves estimation by experiment. Ideally I'm looking for a cookbook type book less so than a theory book.

If you're referring to financial markets, I personally learned a lot from Trading and Exchanges: Market Microstructure for Practitioners, although I didn't finish it. But it explains the basic characteristics of financial markets, and why they are set up the way they are. It isn't necessarily going to be obvious and financial markets are based on hundreds of years of accumulated knowledge.

Comment · 8 years ago
Ok, I doubt I'll ever take an hour to listen to this, but I really enjoyed the book. It was very interesting to see the little particularities of the legal system and the participants that had a big impact. I basically read it straight through in one shot as the host said he did as well. I found the writing to be florid at times (there was a seamless segue between an anecdote of Julius Caesar crossing the Rubicon and Hulk Hogan's decision to sue against the distribution of the hidden camera sextape that made me actually laugh out loud) but I found the asides were unobtrusive enough that it didn't affect the reading.
Comment · 8 years ago
Comment · 8 years ago
Thanks, not OP but that looks useful to me. For context, I've used the strategy in OP to debug a small linux system running on an SD card, if I have one version that has a bug and one that doesn't, and I don't know the difference, I can image them both, mount them and diff the whole system (i.e. with meld.) And it can be done with the same card over time. I'd like to figure out how to do this with VM disks as well but I've never had a pressing need.
Comment · 8 years ago
I like the way Ben Horowitz puts it in his good pm, bad pm document:

Good product managers focus the team on revenue and customers. Bad product managers focus team on how many features Microsoft is building. Good product managers define good products that can be executed with a strong effort. Bad product managers define good products that can’t be executed or let engineering build whatever they want (i.e. solve the hardest problem).

As an engineer, I want to find the demons that are out there in the problem space and assault them, I want to eliminate all weakness from my precious software. But from the business POV I know we need to provide value to customers quickly and efficiently with the available resources, which is usually not the same thing.

Comment · 8 years ago
For typing I doubt it, ideally you should be able to type fine if the display only updated every 10 seconds.

For i.e. the arrow keys, or anything interactive you will probably have to be watching for the response.

Comment · 8 years ago
I think it is a very reasonable test. There are other industries that regulate themselves in other ways. For example, a huge training process and then jail time for lying about it, for doctors or lawyers. Or other ways to eliminate the risk like hiring as contractors for specific jobs, or comission based payment.

For a senior role:

1. Someone who can't write and debug a for-loop and an if-statement isn't going to be able to provide training and support to junior level hires. At all.

2. Making high-level changes and performance improvement both require good process discipline, and the ability to write a lot of code to actually accomplish it.

I think there are high value software management tactics that can be implemented without knowing how to code, for example, change control, or enforcing limits on work in progress via. kanban, but for a role that has either "software" or "developer" I think fizzbuzz is a very low bar.

I personally like binary search as in interview question. The basic principle is simple, but there are enough edge cases and variations to make it interesting.

Comment · 8 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton