After correcting a corrupted IDE workspace and SkyPe discussions
found the funnies were timing errors.
Changing timebase to 1 000 000 (from 1000 000 000 fixed the sensor FB funnies
But debug trace data having valid values means its may not because of 32bit value overflow.
So parts of SkyPe discussions are below to not lose info, when time to look closer why it now works, First part described the funnies, bold is the discovery it was a time problem, afterwards the process and testing of the timebase change.
[8/22/2011 9:59:02 AM] Alois Zoitl: should it turn of if Last test I tried turning L_OFF off via Q=0 and it still turns off.
[8/22/2011 10:33:45 AM] Carolyn Oates: It works now...
[8/22/2011 10:33:54 AM] Carolyn Oates: Next test is touch sensor
[8/22/2011 10:40:45 AM] Carolyn Oates: L_TOUCH test works
[8/22/2011 10:40:59 AM] Alois Zoitl: (y)
[8/22/2011 10:48:47 AM] Carolyn Oates: OK I will send the app to see if there is any obvious (dum) errors.
[8/22/2011 10:49:06 AM] Alois Zoitl: give me about 5 minutes and I#m finsihed withmy test
[8/22/2011 10:49:15 AM] Alois Zoitl: and I should definitly improve my typing
[8/22/2011 10:51:04 AM] *** Carolyn Oates sent FlipFlopapp.PNG ***
[8/22/2011 10:51:32 AM] Carolyn Oates: back in a minute
[8/22/2011 10:53:32 AM] Alois Zoitl: app looks fine
[8/22/2011 10:57:26 AM] Carolyn Oates: that's bad news since it does work... but I stepped through it and it turned on and off like it should.
[8/22/2011 10:57:38 AM] Carolyn Oates: I mean doesnt work
[8/22/2011 11:00:20 AM] Alois Zoitl: strange
[8/22/2011 11:10:58 AM] Alois Zoitl: I was asking if you ar getting the trues and flases in the LMS block
[8/22/2011 11:11:00 AM] Alois Zoitl: on Q
[8/22/2011 11:11:14 AM] Carolyn Oates: yes
[8/22/2011 11:15:07 AM] Alois Zoitl: in this case it seems that your seeting code may be an issue
[8/22/2011 11:15:29 AM] Carolyn Oates: wierd.. Jtag usb to pc unplugged but attached to lms; lms usb unplugged; put battery in and NO boot blinky
[8/22/2011 11:15:43 AM] Carolyn Oates: plugged in the jtag usb and boot blinky started
[8/22/2011 11:17:08 AM] Alois Zoitl: very strange
[8/22/2011 11:17:35 AM] Alois Zoitl: mabe an unpowered jtag disturbs the lego chip
[8/22/2011 11:17:48 AM] *** Carolyn Oates sent flipflopcycle.PNG ***
[8/22/2011 11:17:58 AM] Carolyn Oates: Seems too.
[8/22/2011 11:19:17 AM] Carolyn Oates: On the on / off. That is 1 reason why I tried touch test.
[8/22/2011 11:20:27 AM] Carolyn Oates: True its on LMS - sorry
[8/22/2011 11:20:32 AM] Alois Zoitl: no problem
[8/22/2011 11:20:54 AM] Carolyn Oates: But wanted to try a different way.. no difference
[8/22/2011 11:20:57 AM] Alois Zoitl: don't understand this one:
[8/22/2011 11:20:59 AM] Alois Zoitl: [Monday, August 22, 2011 11:22 AM] Carolyn Oates:
<<< On the on / off. That is 1 reason why I tried touch test.
[8/22/2011 11:21:59 AM] Carolyn Oates: Blinky has input that is output from another FB that toggles
[8/22/2011 11:22:25 AM] Alois Zoitl: ok and with touch it blinks and with E_CYCLE not
[8/22/2011 11:22:33 AM] Carolyn Oates: Touch as button to turn LED on and off also uses FB output to toggle the LED
[8/22/2011 11:22:40 AM] Carolyn Oates: right
[8/22/2011 11:23:50 AM] Carolyn Oates: I had hoped I had a dum timing error in the app.. since when I traced it the LED went on and off as expected.
[8/22/2011 11:25:01 AM] Alois Zoitl: seams like an issue in E_C_YCLE or delay
[8/22/2011 11:25:14 AM] Alois Zoitl: can you set a break point there to chekc if they are activated
[8/22/2011 11:25:46 AM] Carolyn Oates: There is an ecycle in the touch app
[8/22/2011 11:28:18 AM] Alois Zoitl: ok thats strange now
[8/22/2011 11:28:40 AM] Carolyn Oates: I am going to test e delay with another app
[8/22/2011 11:28:44 AM] Alois Zoitl: and E_RS is used in the lms_mrt_RES
[8/22/2011 11:29:03 AM] Alois Zoitl: but at least the light should go on
[8/22/2011 11:29:03 AM] Carolyn Oates: E_RS is excluded... using E_SR
[8/22/2011 11:29:24 AM] Alois Zoitl: ups mixed the chars
[8/22/2011 11:29:25 AM] Carolyn Oates: Its in the exclude list?
[8/22/2011 11:29:32 AM] Alois Zoitl: meant E_SR
[8/22/2011 11:29:54 AM] Carolyn Oates: Yes E_SR is reached early on... I wondered why
[8/22/2011 11:30:36 AM] Carolyn Oates: Just minute.. I will test E_DELAY ... t#10000ms is ok?
[8/22/2011 11:34:17 AM] Alois Zoitl: should be ok
[8/22/2011 11:34:28 AM] Alois Zoitl: just a second this could be the reason
[8/22/2011 11:34:51 AM] Alois Zoitl: what values do you have set for the timebase and for support of 64bit values
[8/22/2011 11:34:57 AM] Carolyn Oates: E delay does not seem to wait for the time
[8/22/2011 11:35:13 AM] Carolyn Oates: 64 bit false
[8/22/2011 11:35:21 AM] Carolyn Oates: timebase ..have to look
[8/22/2011 11:36:06 AM] Alois Zoitl: ok maybe there is a bug in e_DELAY
[8/22/2011 11:36:10 AM] Alois Zoitl: then
[8/22/2011 11:36:39 AM] Carolyn Oates: FORTE_TimeBaseUnitsPerSecond:STRING=1000000000
[8/22/2011 11:36:47 AM] Alois Zoitl: which is hower strange as it uses the same code as E_CYCLE
[8/22/2011 11:37:09 AM] Alois Zoitl: you may want to change this value to 1000 or 1000000
[8/22/2011 11:37:26 AM] Alois Zoitl: will give you some advantages when not supporting 32Bits
[8/22/2011 11:37:45 AM] Carolyn Oates: I think I did winmerge compare of e_delay using and what is in HG
[8/22/2011 11:38:16 AM] Alois Zoitl: you will not notice much difference as the code is in the base class timedfb
[8/22/2011 11:39:11 AM] Carolyn Oates: off the top of your head any changes in timedfb this summer?
[8/22/2011 11:39:44 AM] Alois Zoitl: there has been some changes with time but I think they whare before sommer
[8/22/2011 11:40:55 AM] Alois Zoitl: the only thing I could image would be that the time value is not correctly parsed therefore the E_DEALY is invoked with little to now delay if the same happens for the e_cycle in the push button sensor example you would#nt have noticed
[8/22/2011 11:41:43 AM] Alois Zoitl: would you mind putting a break point into: CTimerHandler::registerTimedFB
[8/22/2011 11:42:12 AM] Carolyn Oates: OK but be aware sometimes when debug I get a Device wont start message
[8/22/2011 11:42:12 AM] Alois Zoitl: and let me know which value pa_pstTimerListEntry->m_nInterval has after line 18 is executed
[8/22/2011 11:42:20 AM] Alois Zoitl: thats fine
[8/22/2011 11:44:04 AM] Carolyn Oates: OK give me minute
[8/22/2011 11:44:20 AM] Carolyn Oates: Should I try the lowering timebase first?
[8/22/2011 11:44:51 AM] Alois Zoitl: better not so that we have "einen schuldigen" :) if it is wrong
[8/22/2011 11:45:42 AM] Carolyn Oates: Define (in deutsch weil Idioms sind besser erklaren in die gleiche Sprache)
[8/22/2011 11:46:45 AM] Alois Zoitl: einen Schuldigen zu haben ist dahingehen gut weil man den dann gleich bestrafen kann. Oft sagt man in deutshc auch sündenbock
[8/22/2011 11:47:06 AM] Alois Zoitl: und wenn wir sehen das wir an dieser stelle was falsch haben könne wir mla das offensichtliche ändern und schauen obs dann geht
[8/22/2011 11:48:21 AM] Carolyn Oates: OK and I can't really translate it to idiomic English
[8/22/2011 11:48:40 AM] Carolyn Oates: other than side effect
[8/22/2011 11:48:50 AM] Alois Zoitl: http://dict.leo.org/ende?lp=ende&lang=de&searchLoc=0&cmpType=relaxed§Hdr=on&spellToler=&search=s%C3%BCndenbock
[8/22/2011 11:49:07 AM] Alois Zoitl: side effect would be more on the technical side
[8/22/2011 11:49:25 AM] Alois Zoitl: scapegoat more on the intercultural
[8/22/2011 11:49:40 AM] Carolyn Oates: true
[8/22/2011 11:55:32 AM] Carolyn Oates: Breakpoint seems to have worked, but download failed
[8/22/2011 11:55:53 AM] Alois Zoitl: not good
[8/22/2011 11:58:35 AM] Carolyn Oates: Just to check OpenOCD has to be open before Insight?
[8/22/2011 11:58:50 AM] Alois Zoitl: at least before you press connect
[8/22/2011 11:59:55 AM] Carolyn Oates: I do the connect after I do Continue, but of course before deploy download
[8/22/2011 12:00:17 PM] Alois Zoitl: ok
[8/22/2011 12:02:02 PM] Carolyn Oates: arm insight quit?
[8/22/2011 12:02:23 PM] Alois Zoitl: ???
[8/22/2011 12:03:16 PM] Carolyn Oates: yeah? OK starting over
[8/22/2011 12:03:25 PM] Alois Zoitl: ok
[8/22/2011 12:04:25 PM] Carolyn Oates: Oh I think I know The app turns the LMS off... may edelay is working
[8/22/2011 12:05:17 PM] Alois Zoitl: with the changed time base?
[8/22/2011 12:06:55 PM] Carolyn Oates: No didnt change time base
[8/22/2011 12:07:24 PM] Alois Zoitl: ok strange
[8/22/2011 12:08:04 PM] Carolyn Oates: No forget that.... I think the LMS turned itself off... but not sure why.
[8/22/2011 12:08:25 PM] Alois Zoitl: ok if you don't mind I would have to go
[8/22/2011 12:09:02 PM] Carolyn Oates: After being on awhile the LMS or JTAG seems to need a break.
[8/22/2011 12:09:45 PM] Alois Zoitl: interesting
[8/22/2011 12:09:51 PM] Alois Zoitl: should we schedule another meeting?
[8/22/2011 12:10:09 PM] Carolyn Oates: I unplugged the jtag and lms usb cables and will test again
[8/22/2011 12:10:19 PM] Carolyn Oates: one last test if its ok
[8/22/2011 12:10:24 PM] Alois Zoitl: ok
[8/22/2011 12:15:46 PM] Carolyn Oates: Line 19 - right?
[8/22/2011 12:16:18 PM] Alois Zoitl: yes the interesting stuff happens in 18
[8/22/2011 12:16:26 PM] Alois Zoitl: at least in my version
[8/22/2011 12:17:00 PM] Carolyn Oates: Insight definitely quit on its own, because my breakpoints reverted to what I had before
[8/22/2011 12:17:37 PM] Alois Zoitl: ok maybe some bug in insight
[8/22/2011 12:18:05 PM] Carolyn Oates: I will watch closer this time
[8/22/2011 12:18:37 PM] Alois Zoitl: ok
[8/22/2011 12:20:21 PM] Carolyn Oates: have to be faster at looking at local variables
[8/22/2011 12:20:38 PM] Carolyn Oates: It stops at the lock but something keeps running...
[8/22/2011 12:20:47 PM] Alois Zoitl: strange
[8/22/2011 12:21:09 PM] Carolyn Oates: I get errors on the IDE side about connect and device not starting ..then insight quits
[8/22/2011 12:21:38 PM] Alois Zoitl: ok seems like an isue of the dubbger
[8/22/2011 12:21:53 PM] Carolyn Oates: Last IDE error before insight quits is Starting Resource "lego" failed.
[8/22/2011 12:22:16 PM] Carolyn Oates: Or a time out on the IDE side that closes the connection
[8/22/2011 12:22:46 PM] Alois Zoitl: this could be the case when your are with in the break-point and not sending the response in time
[8/22/2011 12:22:55 PM] Alois Zoitl: you could try with increasing conneciton timeout in the ide
[8/22/2011 12:23:53 PM] Alois Zoitl: you can also check if the value claculate in line 18 is 0 if you it means there is an isse wutih the DT parameter
[8/22/2011 12:24:10 PM] Alois Zoitl: you can try to change time base value that should definitly help
[8/22/2011 12:27:38 PM] Carolyn Oates: Changing the delay was easy
[8/22/2011 12:43:09 PM] Carolyn Oates: Hope you get this... mostly to document in one place /conversation....
[8/22/2011 12:44:16 PM] Carolyn Oates: The LMS needing a break `= USB "reset" is needed after insight quits via IDE timeout. And Insight will not connect otherwise
[8/22/2011 1:01:50 PM] Carolyn Oates: Value calculated was 2. Since first delay is for 2000ms, if that means 2 seconds then everything seems right.
[8/22/2011 1:02:10 PM] Carolyn Oates: Also let me know if you get these messages
[8/22/2011 1:09:13 PM] Carolyn Oates: LMS connected to JTAG via cable, but no USB connections to PC does not boot with
blinky. Without cable connected to JTAG, the LMS boots with blinky ok.
[8/23/2011 2:08:12 AM] Alois Zoitl: [Monday, August 22, 2011 1:05 PM] Carolyn Oates:
<<< Value calculated was 2. Since first delay is for 2000ms, if that means 2 seconds then everything seems right.
[8/23/2011 2:08:26 AM] Alois Zoitl: should not be 2
[8/23/2011 2:08:44 AM] Carolyn Oates: I think its a millisecond definition problem.
[8/23/2011 2:09:04 AM] Alois Zoitl: I think it has been a 32Bit overvlow problem
[8/23/2011 2:09:10 AM] Alois Zoitl: but I may be wrong
[8/23/2011 2:09:15 AM] Alois Zoitl: does it work now correctly
[8/23/2011 2:09:47 AM] Carolyn Oates: Think so.. I was just tracing it. Current value is wierder
[8/23/2011 2:10:24 AM] Carolyn Oates: No I moved the 2000 ms delay so 1500 comes first
[8/23/2011 2:10:26 AM] Alois Zoitl: for 2 seconds it should be arround 2000
[8/23/2011 2:10:47 AM] Carolyn Oates: Yes everything works fine with timebase=1000000
[8/23/2011 2:11:12 AM] Alois Zoitl: the timebase just gives the base for the values in time
[8/23/2011 2:11:24 AM] Carolyn Oates: Yes 2 for 2 seconds with 1000000000 sounds reasonable... but it only delayed 2 ms
[8/23/2011 2:11:39 AM] Alois Zoitl: the timertickspersecond give the timer as it is configured in ecos and how it is handled in the timerhandler
[8/23/2011 2:12:16 AM] Alois Zoitl: the 2 in line 18 means that it will be activated after two ticks in the timier handler as we configured ecos to have 1ms timer ticks the 2ms are perfectly clear
[8/23/2011 2:12:54 AM] Carolyn Oates: OK and now it is 2000 which means now and why?
[8/23/2011 2:13:32 AM] Alois Zoitl: 2000 means that after 2000 timer ticks the delay will be activated
[8/23/2011 2:13:49 AM] Carolyn Oates: And timebase means?
[8/23/2011 2:14:34 AM] Alois Zoitl: as we may have different timebases for the values stored in the datatype time and the timerhandler we need to do some calcuations and it seams that with the timebase 10E9 we had an overflow
[8/23/2011 2:15:28 AM] Carolyn Oates: where?
[8/23/2011 2:16:01 AM] Carolyn Oates: not in timerha.cpp line 18
[8/23/2011 2:21:18 AM] Alois Zoitl: this is one of the lines where such a calculation is performed
[8/23/2011 2:21:25 AM] Alois Zoitl: in general the calcuations are ok
[8/23/2011 2:21:37 AM] Carolyn Oates: I think you mixed unsigned and signed
[8/23/2011 2:21:43 AM] Alois Zoitl: the problem is only that 10E9 is a veryl largnumber that goes beyond the scoape of a 32bit number
[8/23/2011 2:22:00 AM] Carolyn Oates: Not if its unsigned
[8/23/2011 2:23:17 AM] Alois Zoitl: Time is signed and has tob esigend
[8/23/2011 2:23:24 AM] Carolyn Oates: 1000 000 000 = 3BB9A CA00 which is only 8 hex digits
[8/23/2011 2:24:00 AM] Alois Zoitl: yes it even works with sigend but if you do some claculations around it like multiplications you will soon be beyound the region
[8/23/2011 2:24:57 AM] Carolyn Oates: OK it can overflow... but in the case in question it got a 2 so no overflow
[8/23/2011 2:26:12 AM] Carolyn Oates: (Real question is... does changing the timebase fix or hide the real problem)
[8/23/2011 2:26:37 AM] Alois Zoitl: mise don't know
[8/23/2011 2:26:49 AM] Alois Zoitl: as long as it works I'm fine
[8/23/2011 2:27:44 AM] Carolyn Oates: OK for now I hope... something to look at on the plane when I cant use the jtag ;)
Thursday, August 25, 2011
Tuesday, August 16, 2011
Aug. 16 Start-up Observations
Continuing to test the Forte 0.4 code with C++ rewrite of the LMS.
Lots of time interruptions, but noticing details this time around.
Currently testing initializing all sensor ports at start-up.
- If the start-up time is too long then the LMS is not recognized as an eCos device:
- Added a delay to verify the default state of the sensors before turning them off
- With this delay device is not recognized as an eCos device
- Without this delay it is recognized
- LED default values:
- LMS turned on, Sensor ports uninitialized:
- LED on : Ports 1-3
- LED off : Port 4 (RS485)
- After Sensors initalized
- LED on: All sensor ports
- Sensor port seem to need to be initialized in the FBs not just AVR code (?) at least Port 4
Current Test status:
[Note: with interruptions seems like 2 steps forward 1 step backwards]
Having problems with any called via C++ code.
Friday, August 12, 2011
Aug.12 LED Sensor Working (C++)
In Houston- With OpenOCD working, can test with JTAG for first time when not in Austria.
TODO to polish LED:
- 1st LED and port management to set a pattern.
- - initial all ports
- - led from FB
- - reserve port centrally
For next meeting:
C++ Questions:
- constructors and destructors ??
use new and delete
Note: 9/19 new and delete not needed at all using exported FBs
TODO to polish LED:
- 1st LED and port management to set a pattern.
- - initial all ports
- - led from FB
- - reserve port centrally
For next meeting:
C++ Questions:
- constructors and destructors ??
use new and delete
Note: 9/19 new and delete not needed at all using exported FBs
Subscribe to:
Posts (Atom)