Chat freely about anything...

User avatar
By cnlohr
#1208 I am having a bear of a time decompiling the libphy.a. Even if I use the xt tools, it still mangles the code. I'm trying to read the ASM for what updates the TX power and rx_gain_swp details, however, I can't get there. I've tried looking at a lot of variables, but I feel it won't be enough without looking at some disassembly.

I'm using (tool)-objdump -S libphy.a - none of the names make sense :-/. Any input would be greatly appreciated.
User avatar
By Bert
#1239 Be reminded that rx_gain_swp is in .data and is hence not executable, nor will it disassemble. If you ask me, it's an array of 16 bit unsigned integers (little-endian) with values: 0x00 0x04 0x20 0x24 0x28 0x2c 0x30 0x34 0x40 0x60 0x64 0x68 0x70 0x74 0x78 0x7c.

You'll have more luck if you first compile a simple/empty project, and disassemble that monster. I use the following makefile for that:
Code: Select allXCC = xt-xcc
LDDIR = ../ld
LIBDIR = ../lib

%.o: %.c
   $(XCC) -L$(LIBDIR) -nostdlib -T$(LDDIR)/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -ljson -Wl,--end-group $< -o $@


I then compiled stub.o (out of stub.c, which only contains "void user_init(){}"), linking everything to its correct address (which makes the disassembly way more readable). From the disassembly (xt-objdump -D stub.o) you'll find that rx_gain_swp is addressed indirectly from phy_bb_rx_cfg (i.e. by having its address stored at chip_v6_rxmax_ext+0xac).
User avatar
By cnlohr
#1252 I totally understood that. I was trying to find the value they use to look up into that table. I wanted to read the current RX quality as fast as possible, i.e. on a per-packet basis if possible. But, I can't disassemble the code to figure out what goes into that.

*EDIT* Interesting after looking at this output, it gives me some ideas.

P.S. I will look through the other driver this evening.

Thanks, all!