Difference between revisions of "Start Development"

From Rigol Homebrew Wiki
Jump to: navigation, search
Line 22: Line 22:
 
=== Pitfalls ===
 
=== Pitfalls ===
  
* Alignment
+
; Alignment
Every command must be word aligned. When you access the memory, word accesses must be word aligned, long word accesses must be long word aligned.
+
: Every command must be word aligned. When you access the memory, word accesses must be word aligned, long word accesses must be long word aligned.  
Don't use the .align directive !! It doesn't works with the toolchain.
+
: '''Don't''' use the .align directive . It doesn't works with the toolchain. Use .byte directives to do that.
  
* Subroutines / Calls
+
; Subroutines / Calls
Every subroutine that calls subroutines must start with LINK and end with UNLINK to save the return address to the stack. The blackfin CPU doesn't do that automatic.
+
: Every subroutine that calls subroutines must start with LINK and end with UNLINK to save the return address to the stack. The blackfin CPU doesn't do that automatic.
  
 
Example:
 
Example:
Line 40: Line 40:
 
   UNLINK
 
   UNLINK
 
   RTS
 
   RTS
 +
 +
; STOP-Mode
 +
: Switch your scope to the STOP-Mode if you don't need capturing during your software is working. Sometimes i got unpredictable crashs when the Device was in AUTO-Mode. Hope to find a reason for this thing soon.

Revision as of 15:22, 22 December 2011

Sorry, not complete yet...

Download the Toolchain from https://github.com/krater/rigol-toolchain

and follow the instructions in the README file...





howto compile examples

links to blackfin prm



Pitfalls

Alignment
Every command must be word aligned. When you access the memory, word accesses must be word aligned, long word accesses must be long word aligned.
Don't use the .align directive . It doesn't works with the toolchain. Use .byte directives to do that.
Subroutines / Calls
Every subroutine that calls subroutines must start with LINK and end with UNLINK to save the return address to the stack. The blackfin CPU doesn't do that automatic.

Example:

sub:
  LINK 0x0

  ...
  CALL sub2
  ...

  UNLINK
  RTS

; STOP-Mode
: Switch your scope to the STOP-Mode if you don't need capturing during your software is working. Sometimes i got unpredictable crashs when the Device was in AUTO-Mode. Hope to find a reason for this thing soon.