#microSD for CM-Home board

<abstract>
The CM-Home board is fully compatible with the Raspberry Pi CM4S board so if you use any 
microSD that works on a Raspberry Pi it will work also on a CM-Home board. 
This guide explains how to activate the special hardware mounted on the CM-Home that is not
available on the Raspberry Pi.
</abstract>

## Previous version of this article

<abstract>
Following are the old instruction to make a microSD starting from a Raspberry Pi OS Release date: January 28th 2022
</abstract>

### STEP 1 - Create a standard Raspberry Pi MicroSD

<blockquote markdown="1">
Go to <https://www.raspberrypi.org/software/operating-systems/> page and follow the instructions
to create a bootable MicroSD for Raspberry Pi. Select the __lite version__  because 
the CM-Home board doesn't have any video interface. 
</blockquote>

### STEP 2 - Add some lines to config.txt files to enable CM3-Home specific hardware

<blockquote markdown="1">
While booting up, the Raspberry Pi reads some configuration parameters 
from the first partition of MicroSD card. 

These parameters are stored in a file named __config.txt__ inside the first microSD partition.

You can edit this configuration from any PC because the first partition is 
formatted as FAT so it is compatible with Mac, Win an Linux. Use an ASCII editor 
like Nodepad or similar (please don't use Word :-) and add these lines at the end of this file:

	#Ignore the HDMI cable hotplug (to avoid the delay at startup)
	hdmi_ignore_hotplug=1

	# Set the debug port on GPIO32, GPIO33 pins
	force_turbo=1
	dtoverlay=uart1,txd1_pin=32,rxd1_pin=33
	
	# Enable the 1-wire bus
	dtoverlay=w1-gpio,gpiopin=16
	
	# Set the audio lines on GPIO40 and GPIO41 pins
	dtoverlay=pwm-2chan,pin=40,func=4,pin2=41,func2=4
	
	# Disable the Bluetooth
	dtoverlay=pi3-disable-bt
	
	# Set the I2C1 on GPIO 44 and GPIO 45 pins
	dtparam=i2c_arm=on
	dtparam=i2c_arm_baudrate=100000
	dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6
	
	#Enable the IR Linux driver
	dtoverlay=gpio-ir,gpio_pin=20

	#Enable the debug message
	enable_uart=1

It is possible to edit this file also using the Raspberry Pi itself. 
It is located in __/boot/config.txt__. 

</blockquote>

### STEP 3 - Change the console in cmdline.txt files to move the debug port on serial1

<blockquote markdown="1">
Like as __config.txt__ also the file __cmdline.txt__ is saved in the first microSD
partition. Using the same ASCII editor change this parameter:

	console=serial0,115200

in:

	console=serial1,115200
</blockquote>

### STEP 4 - Enable the SSH server

<blockquote markdown="1">
By default the SSH server is disabled on the Raspberry Pi OS microsd images. This could be a problem
when using a CM3-Home because the video interface is not present and so if you don't have 
a serial cable there isn't any other way to get the access to the Linux command line.

Creating an empty file called __SSH__ with no extention on the first microSD partition
the ssh server will be enabled at first startup and you can reach the Linux command prompt
via lan.

	ssh pi@raspberrypi.local
	Password: raspberry
	
</blockquote>

### FINAL STEP - Boot it

<blockquote markdown="1">
Your MicroSD now is ready to be used on the CM3-Home. Go to the [getting started](/CM3-HOME_getting_started) article to
use it.
</blockquote>


