Difference between revisions of "Start Development"
From Rigol Homebrew Wiki
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Sorry, not complete yet... | + | Sorry, not complete yet, you will find some starting point in the examples delivered with the toolchain... |
− | |||
− | |||
− | |||
− | |||
Line 11: | Line 7: | ||
---- | ---- | ||
− | + | === Todo === | |
howto compile examples | howto compile examples | ||
− | |||
----------------- | ----------------- | ||
+ | === Blackfin programming reference === | ||
+ | : If you are new to blackfin development it may be a good idea to read this document. | ||
+ | : [http://www.analog.com/static/imported-files/processor_manuals/bf533_hwr_Rev3.4.pdf Blackfin Processor Hardware Reference] | ||
=== Pitfalls === | === 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. | + | : 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 | + | : '''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 | + | : 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 automaticly. |
Example: | Example: | ||
Line 40: | Line 38: | ||
UNLINK | UNLINK | ||
RTS | RTS | ||
+ | </pre> | ||
+ | |||
+ | ; 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. | ||
+ | |||
+ | === Unlock the Keyboard === | ||
+ | : If you need keyboard interaction, first you should unlock the keyboard for user inputs. | ||
+ | : This lines will do the job: | ||
+ | <pre> | ||
+ | R0=0 | ||
+ | CALL Set_KeyLock | ||
+ | </pre> | ||
+ | : The keyboard is locked, because the serial interface is used to upload and start your software. | ||
+ | : You can see that its locked if the only keycode you get is KC_KEYLOCK (0xc9). |
Latest revision as of 14:33, 25 April 2013
Sorry, not complete yet, you will find some starting point in the examples delivered with the toolchain...
Todo
howto compile examples
Blackfin programming reference
- If you are new to blackfin development it may be a good idea to read this document.
- Blackfin Processor Hardware Reference
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 automaticly.
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.
Unlock the Keyboard
- If you need keyboard interaction, first you should unlock the keyboard for user inputs.
- This lines will do the job:
R0=0 CALL Set_KeyLock
- The keyboard is locked, because the serial interface is used to upload and start your software.
- You can see that its locked if the only keycode you get is KC_KEYLOCK (0xc9).