[Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Mark Rages
This is a follow-on to a previous discussion, which discussion quickly drifted into language-lawyering: https://www.mail-archive.com/mspgcc-users@lists.sourceforge.net/msg10619.html I am trying to use the msp430 simulator built into gdb and am having trouble getting anywhere. I'm using Ubuntu

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Could you try the gdb from the FSF's source tree? It's version 7.7 and has the RH simulator in it. However, I don't think the profiling results from the RH simulator will be useful to you if you want cycle-accurate counts, but it will show you every single instruction being executed. Also,

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Mark Rages
I am not concerned about cycles at the moment, just bit-exact simulation of the CPU. The msp430-run program looks useful, thank you. (Except the msp430-run programs packaged by Debian segfault immediately.) I've compiled gdb-7.7 with --target=msp430 and it works! Is there any best way to pass

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Is there any best way to pass data in / out of the simulator? I guess I can use the run program and set up a memory region for the input data, and write a little main() to feed it into through the algorithm. But if there's an easier way, I'd like to hear about it before I do it the hard

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Mark Rages
On Tue, Jun 3, 2014 at 11:57 AM, DJ Delorie d...@redhat.com wrote: Is there any best way to pass data in / out of the simulator? I guess I can use the run program and set up a memory region for the input data, and write a little main() to feed it into through the algorithm. But if

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Peter Bigot
On Tue, Jun 3, 2014 at 1:10 PM, Mark Rages markra...@gmail.com wrote: On Tue, Jun 3, 2014 at 11:57 AM, DJ Delorie d...@redhat.com wrote: Is there any best way to pass data in / out of the simulator? I guess I can use the run program and set up a memory region for the input data, and

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Wait, a write() syscall made in the msp430 binary can show up on stdout of the simulator? How does that work? Do I need to link in any special function for that? The RH simulator (msp430-elf-run, not msp430-run) supports TI's CIO interface, at least for write(), which means the RH simulator

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
You need to be using msp430-elf-gcc for that feature, not mspgcc as Right, as previously agreed on, we're using msp430-foo for the non-RH tools, and msp430-elf-foo for the RH tools. -- Learn Graph Databases - Download

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Peter Bigot
On Tue, Jun 3, 2014 at 1:26 PM, DJ Delorie d...@redhat.com wrote: Wait, a write() syscall made in the msp430 binary can show up on stdout of the simulator? How does that work? Do I need to link in any special function for that? The RH simulator (msp430-elf-run, not msp430-run) supports

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Will TI be providing sufficient documentation on the CIO API that the msp430 implementation can be completed, thus making the system interface usable in other frameworks? I have enough information to finish the msp interface, I've just had no reason to do so so far. CIO doesn't have exit()

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Peter Bigot
On Tue, Jun 3, 2014 at 1:55 PM, DJ Delorie d...@redhat.com wrote: Will TI be providing sufficient documentation on the CIO API that the msp430 implementation can be completed, thus making the system interface usable in other frameworks? I have enough information to finish the msp interface,

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Is this documented? How can I write drivers to this standard? That's the catch. It's not documented. I have a sample implementation from TI that I used (with permission) to write the simulator/libgloss code. In general, though, the target side works like this: fill up a command buffer at

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
That doesn't really help the rest of us, though. Yup, I've complained to TI about that. I'll bring it up again. I'm interfacing with other external hardware including LCDs and FAT file systems, and I want to re-use the standard libc interface at the application layer. Could you elaborate

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Peter Bigot
On Tue, Jun 3, 2014 at 2:55 PM, DJ Delorie d...@redhat.com wrote: file systems, and I want to re-use the standard libc interface at the application layer. Could you elaborate on this? Are you talking about real hardware talking to real peripherals, or is there a host involved? I'd already

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
I'd already outlined my expectations in the earlier thread; see for example http://www.mail-archive.com/mspgcc-users@lists.sourceforge.net/msg12038.html. If the msp430 version supplies a weak definition of _write() (not write()) newlib uses either write() or _write() depending on which

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread Mark Rages
On Tue, Jun 3, 2014 at 12:55 PM, DJ Delorie d...@redhat.com wrote: Will TI be providing sufficient documentation on the CIO API that the msp430 implementation can be completed, thus making the system interface usable in other frameworks? I have enough information to finish the msp

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
Can you elaborate on branch-to-self opcode? Any branch opcode that branches to itself, i.e. a one-opcode infinite loop. 1: BR #1b This also works with any indirect or conditional branch, as long as the target of the branch is the address of the branch opcode. Here's the code in the

Re: [Mspgcc-users] MSP430 simulator in gdb

2014-06-03 Thread DJ Delorie
You can do that with the RH newlib as long as you don't link in libgloss's versions of the low-level routines - i.e. remove -lgloss from your link line and add -lbspacm. To clarify: don't link in -lnosys if you're not compiling with -msim or don't link in -lsim if you are compiling with -msim