Trouble linking HSERVO

I’ve been tinkering a bit with my BotBoard II/AtomPro, and Basic Micro Studio (#29) seems to have problems linking anything that uses HSERVO. The code compiles fine, but will not link. I this case, I am trying to build the Autonomous Walk Code from the Biped BRAT Autonomous Tutorial. Even the the smallest program you can make that uses HSERVO will not link.

Any ideas what is wrong?

8-Dale

Ok you are using build 29,

Does the code have the line: ENABLEHSERVO

What is the error message? Something like this?
Error: FILE C:\USERS\KURT\DESKTOP\LYNXMOTION\ABRAT2.BAS(LINE 287) : [TOKEN GETHSERVO] : Unknown Command
Error: FILE C:\USERS\KURT\DESKTOP\LYNXMOTION\ABRAT2.BAS(LINE 287) : [TOKEN LEFTHIP] : Unknown Command
Error: FILE C:\USERS\KURT\DESKTOP\LYNXMOTION\ABRAT2.BAS(LINE 287) : [TOKEN ,] : Unknown Command
Error: FILE C:\USERS\KURT\DESKTOP\LYNXMOTION\ABRAT2.BAS(LINE 287) : [TOKEN :] : Expected =

There was a thread about this a few days (maybe a week) ago that Gethservo was replaced, by two new commands… There are details about these in the thread: viewtopic.php?f=4&t=3224&p=63242#p63242

On my machine I changed the code of abrat1 that looked like:

sensorloop finished = true gethservo lefthip,junk,idle if(NOT idle)then finished=false endif gethservo righthip,junk,idle if(NOT idle)then finished=false endif gethservo leftknee,junk,idle if(NOT idle)then finished=false endif gethservo rightknee,junk,idle if(NOT idle)then finished=false endif gethservo leftankle,junk,idle if(NOT idle)then finished=false endif gethservo rightankle,junk,idle if(NOT idle)then finished=false endif ;add sensor handling code here
To something like:

[code] do
finished = hservoidle(lefthip) and hservoidle(righthip) and hservoidle(leftknee) and hservoidle(rightknee) and hservoidle (leftankle) and hservoidle(rightankle)

	; ??? - we say not to edit, yet???
	;add sensor handling code here
	;adin 0,ir
	;if (ir > 210) then 
	;  detect = true
	;endif	
	
while (NOT finished)[/code]

Which as you said does not link :frowning:

C:\Program Files\BasicMicro\Basic Micro Studio\bin\ld.exe : Unsupported .stab relocation
c:\users\kurt\desktop\lynxmotion\abrat1.o(.text+0x305): undefined reference to `HSERVO_START_PUSLE_0’
c:\users\kurt\desktop\lynxmotion\abrat1.o(.text+0x305): relocation truncated to fit: DISP8 HSERVO_START_PUSLE_0+ffffffff

Sounds like a problem for Nathan?
Kurt

Yes

I commented out all the gethservo lines.

This is the kind of error I am getting. There is no hservoidle statement in the code and only one hservo statement. I can write a very simple 4 or 5 line program that generates the same errors.

Yes, I believe it is.

8-Dale

Yes, there is a typo in 29 for HSERVO(eg not HSERVO2 fro ARC32 boards). I am retesting it today and will have a new release tonight. I spelled part of a label as PUSLE instead of PULSE. It’s an easy fix but I’m going to retest the command to be sure nothing else is wrong with it.

Thanks much, Nathan! I’ll get the new release as soon as it is available.

8-Dale

Fixed and tested. The new download is up on BasicMicro’s AtomPro forums.