readme_arm7.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. *
  2. * efsl SD-Card SPI-Interface for
  3. * - Philips LPC2000 ARM7TDMI-S
  4. * - Atmel AT91SAM7S ARM7TDMI
  5. *
  6. * The LPC2000 and AT91SAM7 interfaces are
  7. * Copyright (c) 2005, 2006
  8. * by Martin Thomas, Kaiserslautern, Germany
  9. * <mthomas@rhrk.uni-kl.de>
  10. * http://www.siwawi.arubi.uni-kl.de/avr_projects
  11. *
  12. All interfaces inherit the license from the
  13. main efsl-source.
  14. -------------------------------------------------
  15. Changelog:
  16. 20060910 mthomas
  17. * bug-fix in AT91SAM7-interface (for CS with GPIO during init)
  18. * variable Chip-Select in AT91SAM7-interface
  19. * applied more patches, sync with efsl 0.2.8
  20. (just one instruction)
  21. * modified AT91SAM7 example
  22. 20060531 mthomas
  23. * applied patches found in the efsl sf.net project-pages.
  24. The patches are marked with #warning in the source since
  25. they are not part of the "official" efsl source-code
  26. -------------------------------------------------
  27. Common "ARM7" Interface Information:
  28. - A GNU arm-elf toolchain/cross-compiler
  29. must be available to build the examples
  30. and the library.
  31. Ready-made toolchains: i.e. WinARM or
  32. GNUARM
  33. Other ARM-compilers may work too but
  34. have not been tested.
  35. - #define BYTE_ALIGNMENT is disabled
  36. for the ARM-interfaces in config*.h
  37. It didn't work with alignment enabled.
  38. - The hardware connection is similar
  39. to the connection described
  40. in the efsl-manual for Atmel AVRs.
  41. Pullup-Resistors should be optional.
  42. Tests did work without pullups.
  43. -------------------------------------------------
  44. For each interface an example application
  45. is provided in the examples-directory. The
  46. examples can be build with the library
  47. libefsl.a or with the efsl source-code.
  48. (1) To use the efsl-source "directly"
  49. - Verfiy that conf/config.h is present
  50. and the settings match the used
  51. interfaces (see templates).
  52. - Modify the line in the example's
  53. Makefile to: EFSL_AS_LIB = 0
  54. - "make all" in the example's directory.
  55. (2) To use the efsl-library (libefsl.a)
  56. - Verfiy that conf/config.h is present
  57. and the settings match the used
  58. interfaces (see templates).
  59. - Build the library libefsl.a with
  60. the Makefile from the efsl root-
  61. directory for the used interface.
  62. (i.e. "make --makefile=Makefile-AT91 lib"
  63. or "make --makefile=Makefile-LPC2000 lib" )
  64. - Modify the line in the example's
  65. Makefile to: EFSL_AS_LIB = 1
  66. - "make all" in the example's directory
  67. The example-applications demonstrate:
  68. - Init of the efsl ARM debug-system
  69. - Init of the efsl
  70. - List contents of the SD-Card's
  71. root directory
  72. - Open a file and type the content
  73. - Append a line of text to a file
  74. - "cat/type" the file's content again
  75. The applications print status- and
  76. debug-messages to the UART1 on
  77. LPC2000 or DBGU on AT91SAM7
  78. (115200,8,N,1,no FC).
  79. -------------------------------------------------
  80. Additional Information for the LPC2000 Interface
  81. - The efsl-interface supports SD-Cards
  82. connected to the LPC2000 SPI ("SPI0")
  83. and SSP ("SPI1") interface. The used
  84. SPI-interface is hardcoded by the value
  85. defined in config.h and can not be
  86. changed during runtime.
  87. - Only some parts of the LPC2000-family
  88. have the fast SSP-Interface (i.e. LPC213x,
  89. LPC214x) others only provide the slower
  90. SPI interface.
  91. - To build the library create the file
  92. conf/config.h based on the template
  93. config-sample-lpc2000.h and use the
  94. makefile Makefile-LPC2000 in the
  95. efsl-root-directory for LPC2000s
  96. (ARM7TDMI-S).
  97. - I have tested the interface with a
  98. LPC2138-controller and the SPI(0)
  99. and SSP/SPI1-Interface. Other
  100. LPC2000-ARM7 controllers should be
  101. supported too. (I have got positive
  102. feedback from LPC2148-users).
  103. Verify that the register-adresses in
  104. inc/interfaces/LPC2000_regs.h
  105. match the used controller and the
  106. maximum speed defined in lpc2000_spi.c
  107. is available for the part. Verify the
  108. pin-connections in lpc2000_spi.c.
  109. Adjust the memory-setting in the linker-script.
  110. - LPC2000 TODO: 16bit, FIFO (patches available at sf.net)
  111. -------------------------------------------------
  112. Additional Information for the AT91 Interface
  113. - The interface supports SD-Cards connected
  114. to the AT91SAM7 SPI interface.
  115. - To build the library create a file
  116. conf/config.h based on the template
  117. config-sample-at91.h and use the
  118. makefile Makefile-AT91 in the
  119. efsl-root-directory for AT91 (ARM7TDMI).
  120. - The AT91SAM7 offers 4 chip-select
  121. signals which can be mapped to
  122. different pins. Chip-select is done
  123. by the hardware. See at91_spi.c
  124. for configuration options.
  125. Chip-Select can be fixed or variable
  126. (Fixed or variable peripheral select - see
  127. option in AT91_spi.c, further information
  128. in the datasheet).
  129. - I have tested the interface with AT91SAM7S256
  130. and SAM7S64 controllers. Other AT91-ARM7 controllers
  131. should be supported too.
  132. To adapt the code for another AT91 with SPI:
  133. - check if the register-defintions in AT91SAM7S_regs.h
  134. are valid for the target. The file can be replaced
  135. by header file provided by Atmel for the used part
  136. (see at91.com)
  137. - verify the maximum speed in at91_spi.c
  138. - verfiy the pin-connections in at91_spi.c
  139. - Check the memory-settings in the linker-script of
  140. the example.
  141. - AT91 TODO: PDC/"DMA", 16bit-transfer, SSC-support,
  142. -------------------------------------------------
  143. Test Hard- and Software:
  144. - Keil (keil.com) MCB2130 board with LPC2138
  145. with additional SD/MMC-connector (from Buerklin.de)
  146. - Atmel AT91SAM7S-EK board with AT91SAM7S64
  147. with additional SD/MMC-connector
  148. - SAM7-P board with AT91SAM7S256
  149. with on-board SD/MMC-connector
  150. - SanDisk "standard" SD-Card 256MB
  151. (not the "highspeed"-version)
  152. - WinARM (arm-elf GNU toolchain)
  153. - Bray++ Terminal
  154. WinARM is available at:
  155. http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
  156. -------------------------------------------------
  157. Credits:
  158. - The code in efsl_debug_printf_arm.c is based
  159. on code from Holger Klabunde and has been
  160. modified to support a "fdevopen"-function
  161. (efsl_debug_devopen_arm).
  162. The original code has no copyright-notice and
  163. is derived from an free code by Volker Oth.
  164. - Register-definitions for LPC213x are
  165. based on a header-file from Keil GmbH
  166. (supplied with the DKARM trial-version).
  167. - Register-definitions for AT91SAM7 are from
  168. at91.com (provided by Atmel).
  169. - The basic method to handle the SPI interface
  170. on AT91 has been found in a free example from
  171. Olimex.com.
  172. -------------------------------------------------
  173. I hope the ARM-interfaces are useful for you.
  174. Martin Thomas 9/2006