Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:add.new.device [2019/01/27 22:01] – [KSEG1ADDR() and accessing NOR flash] Added some whitespace for readability sparks | docs:guide-developer:add.new.device [2022/03/23 12:00] (current) – adding filename for scripts, so that when users post their result they will be able to refer a specific output associated with which script aterik | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| This article assumes your device is based on a platform already supported by OpenWrt. If you need to add a new platform, see -> | This article assumes your device is based on a platform already supported by OpenWrt. If you need to add a new platform, see -> | ||
| + | If you already solved the puzzle and are looking for device support submission guidelines, check out [[docs: | ||
| ===== General Approach ===== | ===== General Approach ===== | ||
| Line 43: | Line 44: | ||
| To speed up testing all GPIOs one by one you can use following bash script. Please note you have to follow LEDs state and console output. If the USB LED turns on and the last console message is '' | To speed up testing all GPIOs one by one you can use following bash script. Please note you have to follow LEDs state and console output. If the USB LED turns on and the last console message is '' | ||
| - | <code># | + | <file bash gpio-test.sh># |
| GPIOCHIP=0 | GPIOCHIP=0 | ||
| BASE=$(cat / | BASE=$(cat / | ||
| Line 65: | Line 66: | ||
| } | } | ||
| gpio=$((gpio+1)) | gpio=$((gpio+1)) | ||
| - | done</code> | + | done |
| + | </file> | ||
| + | * Save the above content as a file '' | ||
| + | * to make it executable, run: '' | ||
| ==== GPIO buttons ==== | ==== GPIO buttons ==== | ||
| Line 77: | Line 81: | ||
| For dumping GPIO values following script can be used: | For dumping GPIO values following script can be used: | ||
| - | <code># | + | <file bash gpio-dump.sh># |
| GPIOCHIP=0 | GPIOCHIP=0 | ||
| BASE=$(cat / | BASE=$(cat / | ||
| Line 91: | Line 95: | ||
| } | } | ||
| gpio=$((gpio+1)) | gpio=$((gpio+1)) | ||
| - | done</code> | + | done |
| + | </file> | ||
| + | * Save the above content as a file '' | ||
| + | * to make it executable, run: '' | ||
| If GPIO value changes from 1 to 0 while pressing the button, it's active low. Otherwise it's active high. | If GPIO value changes from 1 to 0 while pressing the button, it's active low. Otherwise it's active high. | ||
| Line 119: | Line 126: | ||
| For creating the OpenWrt firmware your [[docs: | For creating the OpenWrt firmware your [[docs: | ||
| - | - Obtain the [[docs: | + | - Obtain the [[docs: |
| - During **menuconfig** select the correct target system. | - During **menuconfig** select the correct target system. | ||
| - Next generate the board_bcm963xx.c file for the selected platform with all board parameters execute the following command: \\ < | - Next generate the board_bcm963xx.c file for the selected platform with all board parameters execute the following command: \\ < | ||
| Line 150: | Line 157: | ||
| & | & | ||
| </ | </ | ||
| - | - Finish the [[docs: | + | - Finish the [[docs: |
| ==== Ramips Platform ==== | ==== Ramips Platform ==== | ||