Nikon Emulator

All things embedded.
*NO FEATURE REQUESTS*

Re: Fujitsu Fr Emulator

Postby Vicne » Sun Apr 15, 2012 12:39 am

leegong wrote:But the code still goes on @0x409E6 infinite loop,not task0x100106. The delay interrupt implemented in this version doesn't seem to work, is there anything wrong with my test steps?

Hmmm, it's true that to implement delay interrupt when writing to 0x44, i've set up a 'trap' on Page 0x0000-0xffff, which might be incompatible with the hex editor.
Let me have a look...

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

Re: Fujitsu Fr Emulator

Postby leegong » Sun Apr 15, 2012 12:58 am

Vicne wrote:
leegong wrote:But the code still goes on @0x409E6 infinite loop,not task0x100106. The delay interrupt implemented in this version doesn't seem to work, is there anything wrong with my test steps?

Hmmm, it's true that to implement delay interrupt when writing to 0x44, i've set up a 'trap' on Page 0x0000-0xffff, which might be incompatible with the hex editor.
Let me have a look...
Vicne


I didn't modify @0x44 with HEX editor in my test, the 01 @0x44 is written by code itself.
leegong
Core Developer
 
Posts: 1612
Joined: Mon Mar 19, 2012 12:21 am
Been thanked: 113 times

Re: Fujitsu Fr Emulator

Postby Vicne » Sun Apr 15, 2012 1:27 am

Here's version 1.82 : http://nikon-firmware-tools.googlecode. ... r-1.82.zip
Changes :
- fixed an incompatibility between hex editor and the new "microcontroller register monitoring" architecture
- added a "Queue" tab to the interrupt controller window to see pending requests
- improved disassembly to add syscall names in comment next to INT40. For example :

001001B8 1F40 INT #0x40 ; sys_sta_tsk

leegong, can you check again with this version ?
It's a quick fix, but without that there is no way my procedure for fiddling with 0x138 could have worked.

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

Re: Fujitsu Fr Emulator

Postby leegong » Sun Apr 15, 2012 1:50 am

Vicne wrote:Here's version 1.82 : http://nikon-firmware-tools.googlecode. ... r-1.82.zip
Changes :
- fixed an incompatibility between hex editor and the new "microcontroller register monitoring" architecture
- added a "Queue" tab to the interrupt controller window to see pending requests
- improved disassembly to add syscall names in comment next to INT40. For example :

001001B8 1F40 INT #0x40 ; sys_sta_tsk

leegong, can you check again with this version ?
It's a quick fix, but without that there is no way my procedure for fiddling with 0x138 could have worked.
Vicne


Sure,no problem .
Another question is can i edit register when tracing?
Last edited by leegong on Sun Apr 15, 2012 2:00 am, edited 1 time in total.
leegong
Core Developer
 
Posts: 1612
Joined: Mon Mar 19, 2012 12:21 am
Been thanked: 113 times

Re: Fujitsu Fr Emulator

Postby Vicne » Sun Apr 15, 2012 1:59 am

leegong wrote:I downloaded Emulator v1.81 to test delay interrupt with following steps:
1:Load Firmware
2:Modify @0x1fe58e to skip infinite loop for 4006 matching
3:Run code
But the code still goes on @0x409E6 infinite loop,not task0x100106. The delay interrupt implemented in this version doesn't seem to work, is there anything wrong with my test steps?


A few misc comments :
1) Seeing your capture, I advise you to switch to small buttons: Tools > Options > "User interface" tab > Uncheck "Use large buttons" > OK.
2) There is a way built in the Emulator to skip the 4006 infinite loop: Start the code, then go to Trace > Component 4006 window (or "4006" button), you should see all the traces of code polling the 0x40060010 address. Just press the "Store 0x1000 at 0x40060010" button at the bottom two times (the code loops first waiting for the "component" to be ready, then writes data to it, then loops a second time waiting for the component's "ACK", before going on) :
4006 window.png
4006 window.png (23.52 KiB) Viewed 1361 times

3) I don't see the problem with 0x100106. It gets called as expected (at least in 1.82).

Please watch the screencast below which demonstrates all points : small buttons, use of 4006 window, and hitting the breakpoint at 0x100106. Also notice the disassembly which now shows the syscall names next to INT40 :
http://screencast.com/t/kiastLoG8

Kind regards,

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

Re: Fujitsu Fr Emulator

Postby Vicne » Mon Apr 16, 2012 3:05 am

leegong wrote:Another question is can i edit register when tracing?

Sure, but the emulator must be paused, so either between steps (if you're using the step button to execute one instruction at a time), or by pressing the pause button.
Just modify the value and click "Save". If the emulator is running, the "Save" button is disabled.

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

Re: Fujitsu Fr Emulator

Postby leegong » Mon Apr 16, 2012 5:12 am

Vicne wrote:
leegong wrote:Another question is can i edit register when tracing?

Sure, but the emulator must be paused, so either between steps (if you're using the step button to execute one instruction at a time), or by pressing the pause button.
Just modify the value and click "Save". If the emulator is running, the "Save" button is disabled.
Vicne

Thanks, Vicne.
Here is something important : we should concern about Execution Precedence and Service Calls Atomicity.
I noticed you set the delay interruption with ICR=10000B in v1.82 .If possible,please modify it to the lowest prority ICR=11110.
it will be best to trigger INT0x3F after RTOS returnS control to running task.
Best Regards
Leegong
leegong
Core Developer
 
Posts: 1612
Joined: Mon Mar 19, 2012 12:21 am
Been thanked: 113 times

Re: Fujitsu Fr Emulator

Postby dbritos » Mon Apr 16, 2012 6:03 am

I am assembler programer and not know java, I work in linux OS when i run de FrEmulator.jar in linux i have the following error.

Exception in thread "main" java.lang.NoClassDefFoundError: FrEmulator/jar
Caused by: java.lang.ClassNotFoundException: FrEmulator.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: FrEmulator.jar. Program will exit.
dbritos
 

Re: Fujitsu Fr Emulator

Postby Vicne » Mon Apr 16, 2012 8:57 am

dbritos wrote:I am assembler programer and not know java, I work in linux OS when i run de FrEmulator.jar in linux i have the following error.

Hi, dbritos,

You shouldn't 'run' the jar because I didn't include a manifest and all libs inside it.
Instead, I advise you to create a shell script based on the windows batch file included. Basically, it's a matter of replacing backslashes by slashes, etc.
I could include one by default. I was just too lazy until now.
Don't hesitate to ask in case it doesn't work.

Best regards,

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

Re: Fujitsu Fr Emulator

Postby Vicne » Mon Apr 16, 2012 9:11 am

leegong wrote:Here is something important : we should concern about Execution Precedence and Service Calls Atomicity.
I noticed you set the delay interruption with ICR=10000B in v1.82.If possible,please modify it to the lowest prority ICR=11110.
it will be best to trigger INT0x3F after RTOS returnS control to running task.

I see what you mean...
However, the 0b10000 priority is not a choice I decided and hardcoded, it is read live from the corresponding ICR register like the CPU would do.
If you want to give it a lower priority, you can just change its ICR value to 0b11110 for example (or even 0b11111 to disabled it completely) before the 0x44 register is set to 1.
Alternatively, you can change the ILM of the CPU to prevent it from accepting the request...
But really, I have the impression that the order and priorities of the interrupts reflect the actual microcontroller behaviour...

Vicne
Vicne
Core Developer
 
Posts: 1703
Joined: Tue Nov 29, 2011 2:30 pm
Been thanked: 155 times

PreviousNext

Return to Firmware

Who is online

Users browsing this forum: No registered users and 5 guests