Outils pour utilisateurs

Outils du site


nanopim1:start

NanoPiM1

GPIO

En utilisant les codes de WiringPi pour la NanoPi :

git clone https://github.com/friendlyarm/WiringNP
cd WiringNP/
git checkout nanopi-m1  #uniquement dans le cas d'une NanopiM1
chmod 755 build
./build

Then, you can test it executing this command:

gpio readall

on peut accéder plus facilement à toutes les entrées/sorties

# gpio readall
 +-----+-----+----------+------+---+-NanoPI M1+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
 | 203 |   7 |   GPIO.7 |  OFF | 0 |  7 || 8  | 0 | OFF  | TxD3     | 15  | 198 |
 |     |     |       0v |      |   |  9 || 10 | 0 | OFF  | RxD3     | 16  | 199 |
 |   0 |   0 |     RxD2 |  OFF | 0 | 11 || 12 | 0 | OFF  | GPIO.1   | 1   | 6   |
 |   2 |   2 |     TxD2 |  OFF | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 |  OFF | 0 | 15 || 16 | 0 | OFF  | GPIO.4   | 4   | 200 |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | OFF  | GPIO.5   | 5   | 201 |
 |  64 |  12 |     MOSI | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  65 |  13 |     MISO | ALT4 | 0 | 21 || 22 | 0 | OFF  | RTS2     | 6   | 1   |
 |  66 |  14 |     SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0      | 10  | 67  |
 |     |     |       0v |      |   | 25 || 26 | 0 | OFF  | GPIO.11  | 11  | 17  |
 |  19 |  30 |    SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1    | 31  | 18  |
 |  20 |  21 |  GPIO.21 |  OFF | 0 | 29 || 30 |   |      | 0v       |     |     |
 |  21 |  22 |  GPIO.22 |  OFF | 0 | 31 || 32 | 0 | OFF  | RTS1     | 26  | 7   |
 |   8 |  23 |  GPIO.23 |  OFF | 0 | 33 || 34 |   |      | 0v       |     |     |
 |  16 |  24 |  GPIO.24 |  OFF | 0 | 35 || 36 | 1 | OUT  | CTS1     | 27  | 13  |
 |   9 |  25 |  GPIO.25 |  OFF | 0 | 37 || 38 | 0 | OFF  | TxD1     | 28  | 15  |
 |     |     |       0v |      |   | 39 || 40 | 0 | OFF  | RxD1     | 29  | 14  |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-NanoPI M1+---+------+----------+-----+-----+

 +-----+----NanoPI M1 Debug UART---+----+
 | BCM | wPi |   Name   | Mode | V | Ph |
 +-----+-----+----------+------+---+----+
 |     |     |       0v |      |   | 41 |
 |     |     |       5v |      |   | 42 |
 |   4 |  32 |   GPIO.4 |   IN | 1 | 43 |
 |   5 |  33 |   GPIO.5 | ALT5 | 0 | 44 |
 +-----+-----+----------+------+---+----+

et la base etait

GPIO1 Pin Define	
Pin# 	Name 				Pin# 	Name
1 	SYS_3.3V 			2 	VDD_5V
3 	I2C0_SDA 			4 	VDD_5V
5 	I2C0_SCL 			6 	GND
7 	GPIOG11 			8 	UART1_TX/GPIOG6
9 	GND 				10 	UART1_RX/GPIOG7
11 	UART2_TX/GPIOA0 		12 	PWM1/GPIOA6
13 	UART2_RTS/GPIOA2 		14 	GND
15 	UART2_CTS/GPIOA3 		16 	UART1_RTS/GPIOG8
17 	SYS_3.3V 			18 	UART1_CTS/GPIOG9
19 	SPI0_MOSI/GPIOC0 		20 	GND
21 	SIP0_MISO/GPIOC1 		22 	UART2_RX/GPIOA1
23 	SPI0_CLK/GPIOC29 		24 	SPI0_CS/GPIOC3
25 	GND 				26 	SPDIF-OUT/GPIOA17
27 	I2C1_SDA/GPIOA19 		28 	I2C1_SCL/GPIOA18
29 	GPIOA20 			30 	GND
31 	GGPIOA21 			32 	GPIOA7
33 	GPIOA8 				34 	GND
35 	UART3_CTS/SPI1_MISO/GPIOA16 	36 	UART3_TX/SPI1_CS/GPIOA13
37 	GPIOA9 				38 	UART3_RTS/SPI1_MOSI/GPIOA15
39 	GND 				40 	UART3_RX/SPI1_CLK/GPIOA14

Finalement après test ( merci Peter Scargill et au forum arbian )

  Pin 3 GPIO2 =   gpio write 8 on
  Pin 5 GPIO3 =   gpio write 9 on
  Pin 7 GPIO4 =  gpio write 7 on
  Pin 11 GPIO17 = could not figure out – default off
  Pin 13 GPIO27 = gpio write 2 on
  Pin 15 GPIO22 = gpio write 3 on
  Pin 19 GPIO10 = gpio write 12 on
  Pin 21 GPIO9 = gpio write 13  on
  pin 23 GPIO11 = gpio write 14 on
  pin 29 GPIO5 = gpio write 21 on
  pin 31 GPIO6 = gpio write 22 on
  pin 33 GPIO13 = gpio write 23 on
  pin 35 GPIO19 = gpio write 24 on
  pin 37 GPIO26 = could not figure out – default off
  pin 8 GPIO14 =  gpio write 15 on
  pin 10 GPIO15 =  gpio write 16 on
  pin 12 GPIO18 =  could not figure out – default off
  pin 16 GPIO23 =  could not figure out – default on
  pin 18 GPIO24 =  gpio write 4 on
  pin 22 GPIO25 =  gpio write 6 on
  pin 24 GPIO8 =  gpio write 10 on
  pin 26 GPIO7 =  gpio write 5 on
  pin 32 GPIO12 =  could not figure out – default off
  pin 36 GPIO16 =  could not figure out – default off
  pin 38 GPIO20 =  could not figure out – default on
  pin 40 GPIO21 = gpio write 25 on

ensuite gpio mode 4 input et gpio read 4 donne 1 ou 0 suivant signal

Préparation d'une base avec un support graphiques (XFCE)

Image de départ : http://www.armbian.com/nanopi-m1/ http://www.armbian.com/donate/?f=Armbian_5.20_Nanopim1_Debian_jessie_3.4.112_desktop.7z

pas de graphique chez moi sur mon vieille écran mais bien une connexion ssh car la carte réseau est bien configurée en DHCP , (pass root:1234)

Caméra OV5640

Configuration pour l'utilisation de la caméra OV5640 changement du script.bin

nanopim1.fex

cd /boot
bin2fex script.bin nanopim1.fex

#modifier nanopim1 !!
#
[csi0]
vip_used = 1
vip_mode = 0
vip_dev_qty = 1
vip_define_sensor_list = 0
vip_csi_pck = port:PE00<2><default><default><default>
vip_csi_mck = port:PE01<2><default><default><default>
vip_csi_hsync = port:PE02<2><default><default><default>
vip_csi_vsync = port:PE03<2><default><default><default>
vip_csi_d0 = port:PE04<2><default><default><default>
vip_csi_d1 = port:PE05<2><default><default><default>
vip_csi_d2 = port:PE06<2><default><default><default>
vip_csi_d3 = port:PE07<2><default><default><default>
vip_csi_d4 = port:PE08<2><default><default><default>
vip_csi_d5 = port:PE09<2><default><default><default>
vip_csi_d6 = port:PE10<2><default><default><default>
vip_csi_d7 = port:PE11<2><default><default><default>
vip_csi_sck = port:PE12<2><default><default><default>
vip_csi_sda = port:PE13<2><default><default><default>

vip_dev0_mname           = "ov5640"
vip_dev0_pos             = "rear"
vip_dev0_lane            = 2
vip_dev0_twi_id          = 2
vip_dev0_twi_addr        = 0x78
vip_dev0_isp_used        = 0
vip_dev0_fmt             = 0
vip_dev0_stby_mode       = 0
vip_dev0_vflip           = 0
vip_dev0_hflip           = 0
vip_dev0_iovdd           = ""
vip_dev0_iovdd_vol       = 2800000
vip_dev0_avdd            = ""
vip_dev0_avdd_vol        = 2800000
vip_dev0_dvdd            = ""
vip_dev0_dvdd_vol        = 1500000
vip_dev0_afvdd           = ""
vip_dev0_afvdd_vol       =
vip_dev0_power_en        =
vip_dev0_reset           = port:PE14<1><default><default><default>
vip_dev0_pwdn            = port:PE15<1><default><default><default>
vip_dev0_flash_en        =
vip_dev0_flash_mode      =
vip_dev0_af_pwdn         =

vip_dev0_act_used        = 0
vip_dev0_act_name        = "ad5820_act"
vip_dev0_act_slave       = 0x18
#FIN camera

Puis pour mettre en place le nouveau script.bin

cd /boot
fex2bin  nanopim1.fex script.bin

Utilisation de Guvcview for OPI with CMOS Camera (H3 - A64 - A83T) / NanoPi M2 / M3 with USB camera , télécharger et installer https://github.com/avafinger/guvcview (xawtv ne fonctionne pas)

Autres

Modifications après l'upgrade

    • /etc/default/locale /etc/default/keyboard à modifier et dpkg-reconfigure locales , dpkg-reconfigure tz-data
    • h3disp -m 720p60 -d -c 1 pour une résolution pas trop grande sur un nouvel écran
  • ajout de xx-fr pour les pg , libreoffice, firefox
  • modprobe ov5640 ; modprobe vfe_v4l2

Ajouts

  • au cazou : script pour minimiser la consommation
    echo 0 >/sys/devices/system/cpu/cpu3/online
    echo 0 >/sys/devices/system/cpu/cpu2/online
    echo 0 >/sys/devices/system/cpu/cpu1/online
    echo 408000 >/sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/userspace/set_freq

Recherche autour de l'acces aux GPIO

Connexion sur le moniteur avec un cable serie/USB

Connecter le Debug Port(UART0) en 115200 bauds grace a gtkterm en graphique ou a screen /dev/ttyUSB0 dans le terminal

      Pin# 	Nom            Adaptateur USB/serie ( fil noir/rouge/vert/blanc )
      1 	GND  --------> noir
      2 	VDD_5V  -----> Non Connecté
      3 	UART_TXD0 ---> Blanc
      4 	UART_RXD0 ---> Vert
nanopim1/start.txt · Dernière modification: 2017/05/27 11:24 par gepeto