Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
21c4e72
Updated to the latest frameutils and switched manual file upload code…
siliconwitch Jul 25, 2024
9c2704d
Removed an unneeded todo
siliconwitch Aug 5, 2024
056c247
Showing last four digits of mac address on display at boot-up
siliconwitch Aug 6, 2024
f08946d
Now advertising Frame plus last two digits of mac address
siliconwitch Aug 7, 2024
7f76ee6
Merge pull request #244 from brilliantlabsAR/pairing-improvements
siliconwitch Aug 7, 2024
945fd57
WIP enabled watchdog and running every 100 Lua count
siliconwitch Aug 8, 2024
d5f16a3
Moved watchdog code to dedicated file
siliconwitch Aug 9, 2024
87d6eb0
Improved error looking to show error code
siliconwitch Aug 14, 2024
8c65615
Merge pull request #245 from brilliantlabsAR/watchdog
siliconwitch Aug 14, 2024
5480ad9
Added bluetooth throughput test
siliconwitch Aug 22, 2024
da25b14
cleaned up throughput script
siliconwitch Aug 23, 2024
f9ba6bf
Improved bluetooth throughput from 50kBps to 60Bps
siliconwitch Aug 27, 2024
0dcfcb1
Added feature to show if Frame is paired or not on the display
siliconwitch Aug 28, 2024
1c83f04
Added read command into test fps script
siliconwitch Sep 2, 2024
2f3183a
Added flag logic
siliconwitch Sep 2, 2024
03fd250
built bin
siliconwitch Sep 2, 2024
b74c568
Added image ready function
siliconwitch Sep 2, 2024
8ecd597
Added tests for camera.image_ready() api
siliconwitch Sep 2, 2024
e5686eb
Merge pull request #253 from brilliantlabsAR/image-ready-flag
siliconwitch Sep 2, 2024
1271c82
Bumped MTU to 247. Now getting ~70kB/s
siliconwitch Sep 2, 2024
24c4a06
Added new jpeg files
siliconwitch Sep 3, 2024
2dd7117
Updated radiant project
siliconwitch Sep 3, 2024
0832e81
Added define to infer huffman ROM
siliconwitch Sep 4, 2024
9376cb4
Built with one freed up EBR
siliconwitch Sep 4, 2024
a97dfb1
Merge pull request #254 from brilliantlabsAR/jpeg-merging
siliconwitch Sep 4, 2024
2e2a01e
Updated test audio script to support odd MTU size
siliconwitch Sep 4, 2024
a7912af
Added updated auto-exposure algorithm from Farhad
siliconwitch Sep 4, 2024
f67dc08
Added gamma correction placeholder
siliconwitch Sep 4, 2024
eee2c7e
Added gamma_correction.sv
siliconwitch Sep 4, 2024
95f712f
WIP adding gamma table and logic
siliconwitch Sep 4, 2024
bea9969
Added gamma table gen script
siliconwitch Sep 4, 2024
fc4b945
Trying to prevent inferred EBR
siliconwitch Sep 4, 2024
7510c3d
Fixed data width for data in and out of gamma correction
siliconwitch Sep 5, 2024
ad41e9a
Changed how the fake flipflop is handled
siliconwitch Sep 5, 2024
18837fa
Added correct padding to jpeg data input
siliconwitch Sep 5, 2024
fdab6bd
Using or instead of add
siliconwitch Sep 5, 2024
5fc59ae
Added camera get_register feature
siliconwitch Sep 5, 2024
4319697
Added correction for or
siliconwitch Sep 6, 2024
c2db3c5
Removed reset from gamma block and added validation signals
siliconwitch Sep 6, 2024
a8d7278
Cleaned up camera.c
siliconwitch Sep 6, 2024
23190e7
Fixed stuck gain bug
siliconwitch Sep 10, 2024
cac54b0
changed line endings back to LF
siliconwitch Sep 10, 2024
cfcbecd
Merge pull request #258 from brilliantlabsAR/auto-exposure
siliconwitch Sep 10, 2024
1ab3429
Fixed issue 261. Lua file write was using strlen for length rather th…
siliconwitch Sep 11, 2024
c15b2bb
intial draft - gray world implementation
InnoWaveGitHub Sep 16, 2024
8175503
add the brightness-based AWB speed
InnoWaveGitHub Sep 16, 2024
b19bbd3
Button click ensures Frame stays powered for pairing
siliconwitch Sep 19, 2024
0237bfb
Merge pull request #269 from brilliantlabsAR/raj/reset
siliconwitch Sep 23, 2024
55278c0
Added display power saving function
siliconwitch Sep 30, 2024
539e802
Added audio and camera test script
siliconwitch Oct 1, 2024
01455bc
Refactoring and naming
siliconwitch Oct 2, 2024
00906d8
Merge pull request #266 from brilliantlabsAR/fabed/awb-implementation
siliconwitch Oct 2, 2024
4cd1833
Fixed camera sleep function
siliconwitch Oct 2, 2024
08f3344
Cleaned up AWB variable names
siliconwitch Oct 2, 2024
8ca4e4e
Added code for dphy power down
siliconwitch Oct 4, 2024
21f504e
Build binary
siliconwitch Oct 4, 2024
5b9e41e
Build binary
siliconwitch Oct 4, 2024
2c5e0ad
Build binary
siliconwitch Oct 7, 2024
fe9217f
Added low power mode tweaks to fps test script
siliconwitch Oct 7, 2024
402b7ea
Added deep sleep to test script
siliconwitch Oct 8, 2024
05037a1
Merge pull request #276 from brilliantlabsAR/camera-power-saving
siliconwitch Oct 8, 2024
7c4b47f
enabled PLL power down and built binary
siliconwitch Oct 9, 2024
b0449c0
Add files via upload
rmetchev Oct 10, 2024
61bb62d
Delete camera-jpeg-encoder-architecture.drawio (1).png
rmetchev Oct 10, 2024
2304528
Add files via upload
rmetchev Oct 10, 2024
9c01169
Update JPEG register
rmetchev Oct 10, 2024
02957f5
Merge pull request #278 from brilliantlabsAR/rmetchev-png-patch-1
rmetchev Oct 10, 2024
e2900f0
Revert "Rmetchev png patch 1"
rmetchev Oct 10, 2024
84494ac
Merge pull request #279 from brilliantlabsAR/revert-278-rmetchev-png-…
rmetchev Oct 10, 2024
8aff612
WIP: PLL and graphics SPI registers refactor
rmetchev Oct 11, 2024
cf7089a
WIP camera/jpeg/image buffer - nothing works yet
rmetchev Oct 12, 2024
7be2218
verilator/icarus/modelism compile
rmetchev Oct 12, 2024
0dd443e
WIP
rmetchev Oct 12, 2024
24d5f1b
Added support for InnoWave focusing IP
siliconwitch Oct 17, 2024
8338d07
Added requirements file for production test script
siliconwitch Oct 18, 2024
a131aad
Added innowave submodule
siliconwitch Oct 18, 2024
1adc3fb
Using latest innowave branch
siliconwitch Oct 18, 2024
90b71a8
Bumped to latest innowave commit
siliconwitch Oct 18, 2024
d7676c6
SPI reads & writes working; PLL CSR working; PLL power up working
rmetchev Oct 18, 2024
96de982
Image buffer clock switch seems to work
rmetchev Oct 18, 2024
7cab363
update header
rmetchev Oct 18, 2024
9511f2a
update notes
rmetchev Oct 19, 2024
819a8d1
update notes
rmetchev Oct 19, 2024
13e83ef
cleanup
rmetchev Oct 19, 2024
202556e
copy from origin/raj/jpeg-optimizations branch
rmetchev Oct 19, 2024
09bcbce
Jpeg compress debug checkpoint
rmetchev Oct 19, 2024
cc206da
minor
rmetchev Oct 19, 2024
11a86da
copy from origin/raj/jpeg-optimizations branch
rmetchev Oct 19, 2024
864df9b
merge various diverged changes - WIP
rmetchev Oct 19, 2024
1139fcf
checkpoint
rmetchev Oct 19, 2024
e630b32
copy from robert/slow-jpeg-clock branch
rmetchev Oct 19, 2024
389a114
make latch blocking
rmetchev Oct 19, 2024
b627030
clean up jpeg clock
rmetchev Oct 19, 2024
7ff87a5
compression completes
rmetchev Oct 19, 2024
743acd6
cleanup
rmetchev Oct 19, 2024
eba9dad
copy from origin/raj/jpeg-optimizations branch
rmetchev Oct 20, 2024
b986bc1
copy from origin/raj/jpeg-optimizations branch
rmetchev Oct 20, 2024
f1c9f0b
camera/jpeg environment up & running
rmetchev Oct 20, 2024
4fa3b21
gamma bypass
rmetchev Oct 20, 2024
cfc7be6
clean up if to image buffer
rmetchev Oct 20, 2024
930c01e
speed up sims
rmetchev Oct 20, 2024
e6d0734
dcouple reset from PLL lock
rmetchev Oct 20, 2024
69a96c1
simulation cleanup
rmetchev Oct 20, 2024
d80e1a3
copy from origin/raj/jpeg-optimizations branch
rmetchev Oct 20, 2024
bd80cdc
minor
rmetchev Oct 23, 2024
5c23eda
add graphics SPI test
rmetchev Oct 23, 2024
758938a
add switch buffer
rmetchev Oct 23, 2024
4c92146
update
rmetchev Oct 23, 2024
5c194d9
Add files via upload
rmetchev Oct 23, 2024
40fabcd
Add files via upload
rmetchev Oct 23, 2024
d0c1ce8
Add files via upload
rmetchev Oct 23, 2024
751f11b
Updated detailed JPEG diagram
rmetchev Oct 23, 2024
ce2127a
Add files via upload
rmetchev Oct 23, 2024
26f1cd4
minor
rmetchev Oct 26, 2024
d43d8bb
PLL testbench
rmetchev Oct 27, 2024
30eb699
add assertion
rmetchev Oct 27, 2024
3eba9a0
Update focus_camera_script.py
siliconwitch Oct 29, 2024
81cac5f
Fixed auto-exposure limit bug
siliconwitch Nov 5, 2024
f74e31b
add pll ip sim for simulation reference
rmetchev Nov 7, 2024
4dd19d8
copy from camera cocotb
rmetchev Nov 7, 2024
01a5d3d
fix assertion
rmetchev Nov 7, 2024
112a22f
safe reset for DPHY power down
rmetchev Nov 7, 2024
6f881c4
copy from origin/raj/jpeg-optimizations branch
rmetchev Nov 7, 2024
a5c1a28
update header
rmetchev Nov 7, 2024
ae21795
copy from origin/raj/jpeg-optimizations branch
rmetchev Nov 7, 2024
70a5fed
spi_clock driven from Internal FPGA Fabric Entries
rmetchev Nov 7, 2024
fbb55a6
update CDC constraints for JPEG
rmetchev Nov 7, 2024
2410e92
synth update
rmetchev Nov 7, 2024
722e40c
synth update
rmetchev Nov 8, 2024
28a6b47
copy from origin/raj/jpeg-optimizations branch
rmetchev Nov 8, 2024
6785098
safe routing for SPI clock
rmetchev Nov 8, 2024
f47e4d5
minor
rmetchev Nov 8, 2024
6a84c42
power down PLL and D-PHY, read out image buffer using SPI clock
rmetchev Nov 8, 2024
99821b2
fix typos
rmetchev Nov 8, 2024
a035744
Update Camera register descriptions
rmetchev Nov 8, 2024
e014d99
Update PLL register descriptions
rmetchev Nov 8, 2024
6132d8a
simpler internal spi clock routing
rmetchev Nov 8, 2024
aed6b40
Revert "simpler internal spi clock routing"
rmetchev Nov 8, 2024
2fcf3de
fix typo
rmetchev Nov 8, 2024
83c0ae2
Cleaned up jpeg arch diagram
siliconwitch Nov 14, 2024
6b1e08c
Cleaned up FPGA doc for consistency
siliconwitch Nov 14, 2024
a358ad3
white spacing and annotation
siliconwitch Nov 14, 2024
769b86f
Switched defaults for DPHY and PLL to be on when FPGA starts
siliconwitch Nov 14, 2024
7d369f3
built binary
siliconwitch Nov 14, 2024
dfe23f9
rename
rmetchev Nov 14, 2024
c8f7a30
add graphics test
rmetchev Nov 25, 2024
6a8f5b8
usa same parameters as main
rmetchev Nov 25, 2024
caee24f
Added support for Frame rev8 PCBs with camera on LDO rail
siliconwitch Nov 28, 2024
fa72098
Added tighter gain and shutter limits to camera test scripts
siliconwitch Dec 4, 2024
4e7851a
low level jpeg test
robert-bigstream Dec 5, 2024
c925c69
power down PLL for jpeg readout
robert-bigstream Dec 5, 2024
e1d13a9
Merge branch 'main' into robert/spi-clock-refactor-0
rmetchev Dec 5, 2024
338cec6
Add 4 new QF settings: 20/30/40/80
rmetchev Dec 5, 2024
769e59f
Add 4 new QF settings: 20/30/40/80
rmetchev Dec 5, 2024
ab12c82
add comment
rmetchev Dec 6, 2024
5206572
Remove stale description
rmetchev Dec 6, 2024
cd2460d
clean up spi clock path
Dec 6, 2024
ed8d53f
Merge branch 'robert/spi-clock-refactor-0' of https://github.com/bril…
Dec 6, 2024
4d564fe
add clock gating to image buffer LRAM
rmetchev Dec 6, 2024
3357ced
Added FL programmer to launch
siliconwitch Dec 9, 2024
52f4d10
built binary
siliconwitch Dec 9, 2024
e6be7c1
Added fast camera script
siliconwitch Dec 9, 2024
0eaad7b
Added graphics tb changes
siliconwitch Dec 9, 2024
bfe0258
Reset working on both hardware versions
siliconwitch Dec 9, 2024
6b37f81
add graphics test
rmetchev Dec 9, 2024
9592aec
remove stale tests
rmetchev Dec 9, 2024
2e0f74b
update
rmetchev Dec 10, 2024
699ad76
re-factor graphics SPI register micro-architecture
rmetchev Dec 10, 2024
7f8b553
Merge branch 'main' into robert/spi-clock-refactor-0
rmetchev Dec 10, 2024
da74603
Added initial LED driver
siliconwitch Dec 10, 2024
c77b5c4
built binary
siliconwitch Dec 10, 2024
6826b5e
update for display CDC
Dec 10, 2024
a458988
Merge branch 'robert/spi-clock-refactor-0' of https://github.com/bril…
Dec 10, 2024
b5ea4d0
balance spi clock
Dec 10, 2024
63b8d16
rebuild
Dec 10, 2024
7069aa9
Added LED and display animation tests
siliconwitch Dec 13, 2024
b455a25
test for display
robert-bigstream Dec 13, 2024
e926f9e
Low-level sprite animation program
robert-bigstream Dec 14, 2024
f98a755
add buffer status register
Dec 14, 2024
143d971
rebuild
Dec 14, 2024
6ea9c70
Merge branch 'robert/spi-clock-refactor-0' of https://github.com/bril…
Dec 14, 2024
24e7dc0
add clear flag to debug status reg
rmetchev Dec 14, 2024
cc6b80a
update with updated status reg
rmetchev Dec 14, 2024
eb4b994
rebuild
Dec 14, 2024
23136fe
Add display status register
rmetchev Dec 14, 2024
a57276b
Added display/LED test to production script
siliconwitch Dec 16, 2024
a4c2f47
built binary
siliconwitch Dec 17, 2024
f7f1e38
1) New SPI command with no data 2) clean up buffer status register
rmetchev Dec 18, 2024
ace98f5
rebuild
rmetchev Dec 18, 2024
7f734ce
fix typo
rmetchev Dec 18, 2024
462b014
rebuild
rmetchev Dec 19, 2024
373c565
Merge branch 'robert/spi-clock-refactor-0' of https://github.com/bril…
rmetchev Dec 19, 2024
81f867f
Fix indentation
rmetchev Dec 19, 2024
5a7e2c7
update header
rmetchev Dec 19, 2024
f704676
SPI no-data command
robert-bigstream Dec 19, 2024
130d7fe
obsolete
robert-bigstream Dec 19, 2024
e04fc59
clean up
robert-bigstream Dec 19, 2024
f9effc9
Merge branch 'robert/spi-clock-refactor-0' of https://github.com/bril…
robert-bigstream Dec 19, 2024
60b65cb
fix addressing bug
rmetchev Dec 19, 2024
ef4f8f6
rebuild
rmetchev Dec 19, 2024
2040fe0
PLL & DPHY power down test
robert-bigstream Dec 19, 2024
ec04dd1
Updated fpga_architecture readme
siliconwitch Dec 23, 2024
7564431
reverted back to 512 fixed resolution and removed pan crop
siliconwitch Dec 23, 2024
1250afc
connected resolution input to jpeg block
siliconwitch Dec 23, 2024
af8a6d9
Adjusted camera low level test script to use 512x512 header
siliconwitch Dec 23, 2024
09c0071
built 720 resolution
siliconwitch Dec 27, 2024
3319c03
copy from origin/raj/jpeg-optimizations
rmetchev Dec 27, 2024
8a1ed80
Merge pull request #290 from brilliantlabsAR/robert/jpeg-hdr
rmetchev Dec 27, 2024
72f53d9
Moved crop before debayer
siliconwitch Dec 27, 2024
474419d
built binary
siliconwitch Dec 27, 2024
6eed439
make setting of SENSOR_X_SIZE/IMAGE_X_SIZE/resolution more robust
rmetchev Dec 27, 2024
39927c4
add assertion for image resolution
rmetchev Dec 28, 2024
827265b
Sensor config working
siliconwitch Dec 30, 2024
947ad31
Merge pull request #291 from brilliantlabsAR/main
siliconwitch Jan 2, 2025
49cec98
WIP updating camera.sv to new API
siliconwitch Jan 2, 2025
995f043
Adjusted the QF tables: 15, 20, 25, 30, 35, 40, 50, 60
siliconwitch Jan 2, 2025
56a33de
update testbench simulation models for CSI
rmetchev Jan 2, 2025
9ebc536
cleanup
rmetchev Jan 2, 2025
ec25265
built binary
siliconwitch Jan 3, 2025
d1489d0
JPEG header gen almost working
siliconwitch Jan 3, 2025
44b5645
Added device version test
siliconwitch Jan 6, 2025
2afcfed
fix QT 0x1 generation
rmetchev Jan 7, 2025
5ab8b22
Added pan feature to camera capture
siliconwitch Jan 8, 2025
c49f4bb
Merge pull request #292 from brilliantlabsAR/frame-lite-support
siliconwitch Jan 8, 2025
4d5d1dc
Merge pull request #283 from brilliantlabsAR/robert/spi-clock-refactor-0
siliconwitch Jan 8, 2025
4bf20e2
Added note to launch.json
siliconwitch Jan 8, 2025
77d145d
Corrected camera manual gain lower limit
siliconwitch Jan 13, 2025
5b855f4
Moved production folder to dedicated repository
siliconwitch Jan 13, 2025
396e5ec
Updated FPGA build docs
siliconwitch Jan 21, 2025
eea438b
WIP decompression feature and callback
siliconwitch Jan 30, 2025
9eae8d1
Added initial test
siliconwitch Jan 30, 2025
158f97d
Decompression function working
siliconwitch Jan 31, 2025
88639fa
Cleaned up comments
siliconwitch Jan 31, 2025
8dd9f13
Merge pull request #296 from brilliantlabsAR/compression-library
siliconwitch Jan 31, 2025
1a97c4d
#233 In auto exposure and white balance loop, scale per-channel rgb g…
CitizenOneX Mar 4, 2025
a9ea622
#233 In auto exposure and white balance loop, scale per-channel rgb g…
CitizenOneX Mar 4, 2025
05034a9
Merge branch 'rgb_gain_limit' of https://github.com/brilliantlabsAR/f…
CitizenOneX Mar 4, 2025
d296698
scale max normalized rgb value up to gain scale since it will be indi…
CitizenOneX Mar 6, 2025
5584a35
update to reduce shutter_limit to reduce motion blur, with the conseq…
CitizenOneX Mar 6, 2025
e10abb3
update pairing info on bonding success
uma-shankar-TE Mar 8, 2025
8a98692
return statement added
uma-shankar-TE Mar 10, 2025
dbbeea3
frame update display on DFU
uma-shankar-TE Mar 18, 2025
8a02abd
Merge branch 'rgb_gain_limit' into pairing_flow
uma-shankar-TE Mar 18, 2025
29604c5
removed stay_awake after factory reset
uma-shankar-TE Mar 18, 2025
fdf435f
halted stay_awake and put defaults for auto exposure for better images
uma-shankar-TE Mar 21, 2025
991f40a
Merge pull request #299 from brilliantlabsAR/pairing_flow
uma-shankar-TE Mar 21, 2025
f4a4ce8
two typo fix
CharlesCNorton Jul 24, 2025
3f6af80
Fix buffer overflow in lua_write_to_repl()
seuros Aug 30, 2025
de885b0
Merge pull request #300 from CharlesCNorton/patch-1
nightlyupdates Sep 16, 2025
d309634
Merge pull request #301 from seuros/fix-bluetooth-buffer-overflow
nightlyupdates Oct 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ abc.history
test_scratch_pad*.py

# Temp focusing image and production logs
production/temp_focus_image.jpg
production/focus_image.*
production/log.txt
production/frame-firmware-*.hex
production/frame-firmware-*.hex

# Python virtual env
.venv
18 changes: 16 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,25 @@
"preLaunchTask": "Build",
"interface": "swd",
"device": "nRF52840_XXAA",
"BMPGDBSerialPort": "/dev/cu.usbmodem72AE45F31",
"showDevDebugOutput": "none",
"svdFile": "libraries/nrfx/mdk/nrf52840.svd",
"internalConsoleOptions": "neverOpen",
"loadFiles": [
"libraries/softdevice/s140_nrf52_7.3.0_softdevice.hex",
],
"preLaunchCommands": [
"monitor rtt enable",
"monitor erase_mass",
"load",
],
"linux": {
"BMPGDBSerialPort": "/dev/ttyACM0",
},
"osx": {
// TODO find a way to make this automatic
"BMPGDBSerialPort": "/dev/cu.usbmodem72AE45F31",
// "BMPGDBSerialPort": "/dev/cu.usbmodem72AE30F31",
}
},
{
"name": "Bootloader (Black Magic Probe)",
Expand All @@ -78,7 +86,6 @@
"preLaunchTask": "Build Bootloader",
"interface": "swd",
"device": "nRF52840_XXAA",
"BMPGDBSerialPort": "/dev/cu.usbmodem72AE45F31",
"showDevDebugOutput": "none",
"svdFile": "libraries/nrfx/mdk/nrf52840.svd",
"internalConsoleOptions": "neverOpen",
Expand All @@ -88,9 +95,16 @@
"build/settings.hex"
],
"preLaunchCommands": [
"monitor rtt enable",
"monitor erase_mass",
"load",
],
"linux": {
"BMPGDBSerialPort": "/dev/ttyACM0",
},
"osx": {
"BMPGDBSerialPort": "/dev/cu.usbmodem72AE45F31",
}
}
]
}
21 changes: 20 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
}
},
{
"label": "RTT Debug Console",
"label": "RTT Debug Console (J-Link)",
"type": "shell",
"command": "JLinkRTTClient",
"problemMatcher": [],
Expand All @@ -142,6 +142,25 @@
"showReuseMessage": false,
"clear": true
}
},
{
"label": "RTT Debug Console (Black-Magic)",
"type": "shell",
"osx": {
"command": "pkill SCREEN; screen /dev/tty.usbmodem*3",
},
"linux": {
"command": "pkill screen; screen /dev/ttyACM1",
},
"problemMatcher": [],
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
}
}
]
}
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
# PERFORMANCE OF THIS SOFTWARE.
#

BUILD_VERSION := $(shell TZ= date +v%y.%j.%H%M)
BUILD_VERSION ?= $(shell TZ= date +v%y.%j.%H%M)
BUILD_VERSION := $(BUILD_VERSION)
GIT_COMMIT := $(shell git rev-parse --short HEAD)

BUILD := build
Expand All @@ -31,16 +32,16 @@ BUILD := build
ifeq ($(shell uname), Darwin)
PORT = $(shell ls /dev/cu.usbmodem*1 2> /dev/null | grep "cu.")
else
PORT = $(shell uname)
PORT = /dev/ttyACM0
endif

application:
@make -C source/application
@make -C source/application BUILD_VERSION=$(BUILD_VERSION)

bootloader:
@make -C source/application
@make -C source/bootloader
@make settings-hex-zip
@make -C source/application BUILD_VERSION=$(BUILD_VERSION)
@make -C source/bootloader BUILD_VERSION=$(BUILD_VERSION)
@make settings-hex-zip BUILD_VERSION=$(BUILD_VERSION)

settings-hex-zip:
@echo Building settings file...
Expand Down Expand Up @@ -75,8 +76,8 @@ settings-hex-zip:
release:
@echo Releasing...
@make clean
@make application
@make settings-hex-zip
@make application BUILD_VERSION=$(BUILD_VERSION)
@make settings-hex-zip BUILD_VERSION=$(BUILD_VERSION)
@echo Released

clean:
Expand Down
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Welcome to the complete codebase of the Frame hardware. For regular usage, check

The codebase is split into three sections. The **nRF52 Application**, the **nRF52 Bootloader**, and the **FPGA RTL**.

The nRF52 is designed to handle the overall system operation. It runs Lua, as well as handle Bluetooth networking, AI tasks and power management. The FPGA meanwhile, simply handles acceleration of the graphics and camera.
The nRF52 is designed to handle the overall system operation. It runs Lua, as well as handles Bluetooth networking, AI tasks and power management. The FPGA meanwhile, simply handles acceleration of the graphics and camera.

![Frame system architecture diagram](docs/diagrams/frame-system-architecture.drawio.png)

## Getting started with nRF52 firmware development

1. Ensure you have the [ARM GCC Toolchain](https://developer.arm.com/downloads/-/gnu-rm) installed.
1. Ensure you have the [ARM GCC Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) installed.

1. Ensure you have the [nRF Command Line Tools](https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools) installed.

Expand Down Expand Up @@ -49,36 +49,20 @@ The nRF52 is designed to handle the overall system operation. It runs Lua, as we

Try running the `Build` task. The project should build normally.

You many need to unlock the device by using the `Erase` task before programming or debugging.
You may need to unlock the device by using the `Erase` task before programming or debugging.

1. To enable IntelliSense, be sure to select the correct compiler from within VSCode. `Ctrl-Shift-P` (`Cmd-Shift-P` on MacOS) → `C/C++: Select IntelliSense Configuration` → `Use arm-none-eabi-gcc`.

1. Install the [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) extension for VSCode in order to enable debugging.

1. A debugging launch is already configured within `.vscode/launch.json`. Run the `Application (J-Link)` launch configuration from the `Run and Debug` panel, or press `F5`. The project will automatically build and flash before launching.

1. To monitor the logs, run the task `RTT Console` and ensure the `Application (J-Link)` launch configuration is running.
1. To monitor the logs, run the task `RTT Console (J-Link)` and ensure the `Application (J-Link)` launch configuration is running.

## Getting started with FPGA development

For quickly getting up and running, the accelerators which run on the FPGA are already pre-built and bundled within this repo. If you wish to modify the FPGA RTL, you will need to rebuild the `fpga_application.h` file which contains the entire FPGA application.

1. Ensure you have the [Yosys](https://github.com/YosysHQ/yosys) installed.

1. Ensure you have the [Project Oxide](https://github.com/gatecat/prjoxide) installed.

1. Ensure you have the [nextpnr](https://github.com/YosysHQ/nextpnr) installed.

1. **MacOS users** can do the above three steps in one using [Homebrew](https://brew.sh).
1. To debug using [Black Magic Probes](https://black-magic.org/index.html), follow the instructions [here](/production/blackmagic/README.md).

```sh
brew install --HEAD siliconwitchery/oss-fpga/nextpnr-nexus
```

1. You should now be able to rebuild the project by calling `make`:
## Getting started with FPGA development

```sh
make fpga/fpga_application.h
```
The complete FPGA architecture is described in the documentation [here](docs/fpga-architecture.md).

To understand more around how the FPGA RTL works. Check the documentation [here](docs/fpga-architecture.md).
The FPGA RTL is prebuilt and included in `fpga_application.h` for convenience. If you wish to modify the FPGA RTL, follow the instructions [here](docs/fpga-toolchain-setup.md).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/camera-pipeline-architecture.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 25 additions & 16 deletions docs/fpga-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@ The SPI driver interfaces the FPGA with the nRF52. The FPGA is fully driven over

Each function is accessed through a register. Registers are always addressed by one byte, followed by a various number of read or write bytes based on the operation.

| Address | Function | Description |
|:-------:|-----------------------------|-------------|
| 0x10 | `GRAPHICS_CLEAR` | Clears the background frame buffer.
| 0x11 | `GRAPHICS_ASSIGN_COLOR` | Assigns a color to one of the 16 color palette slots. Color should be provided in YCbCr format.<br>**Write: `palette_index[7:0]`**<br>**Write: `y[7:0]`**<br>**Write: `cb[7:0]`**<br>**Write: `cr[7:0]`**
| 0x12 | `GRAPHICS_DRAW_SPRITE` | Draws a sprite on the screen. The first two arguments specify an absolute x and y position to print the sprite. The sprite will be printed from its top left corner. The third argument determines the width of the sprite in pixels. The fourth argument determines the number of colors contained in the sprite. This value may be 2, 4, or 16. The final argument specifies the color palette offset for assigning the color values held in the sprite against the stored colors in the palette. Following bytes will then be printed on the background frame buffer.<br>**Write: `x_position[15:0]`**<br>**Write: `y_position[15:0]`**<br>**Write: `width[15:0]`**<br>**Write: `total_colors[7:0]`**<br>**Write: `palette_offset[7:0]`**<br>**Write: `pixel_data[7:0]`**<br>**...**<br>**Write: `pixel_data[7:0]`**<br>
| 0x13 | `GRAPHICS_DRAW_VECTOR` | Draws a cubic Bézier curve from the start position to the end position. Control points 1 and 2 are relative to the start and end positions respectively, and are used to determine the shape of the curve. The final argument determines the color used from the current palette, and can be between 0 and 15.<br>**Write: `x_start_position[15:0]`**<br>**Write: `y_start_position[15:0]`**<br>**Write: `x_end_position[15:0]`**<br>**Write: `y_end_position[15:0]`**<br>**Write: `ctrl_1_x_position[15:0]`**<br>**Write: `ctrl_1_y_position[15:0]`**<br>**Write: `ctrl_2_x_position[15:0]`**<br>**Write: `ctrl_2_y_position[15:0]`**<br>**Write: `color[7:0]`**
| 0x14 | `GRAPHICS_BUFFER_SHOW` | The foreground and background buffers are switched. The new foreground buffer is continuously rendered to the display, and the background buffer can be used to load new draw commands.
| 0x20 | `CAMERA_CAPTURE` | Starts a new image capture.
| 0x21 | `CAMERA_BYTES_AVAILABLE` | Returns how many bytes are available to read within the capture memory.<br>**Read: `bytes_available[23:0]`**
| 0x22 | `CAMERA_READ_BYTES` | Reads a number of bytes from the capture memory.<br>**Read: `data[7:0]`**<br>**...**<br>**Read: `data[7:0]`**
| 0x23 | `CAMERA_ZOOM` | Sets the zoom factor. A setting of `1` captures a 720x720 image, `2` captures 360x360, `3` captures 240x240, and `4` captures 180x180.<br>**Write: `zoom_factor[7:0]`**
| 0x24 | `CAMERA_PAN` | Pans the capture window up or down in discrete steps. A setting of `10` captures the top-most part of the image, `0` is the middle, and `-10` is the bottom-most<br>**Write: `pan_position[7:0]`**
| 0x25 | `CAMERA_READ_BRIGHTNESS` | Returns current brightness levels for the red, green and blue channels of the camera.<br>**Read: `red_level[7:0]`**<br>**Read: `green_level[7:0]`**<br>**Read: `blue_level[7:0]`**
| 0x26 | `CAMERA_COMPRESSION_FACTOR` | Sets the compression factor of the saved image between `0` and `100`.<br>**Write: `compression_factor[7:0]`**
| 0xDB | `GET_CHIP_ID` | Returns the chip ID value.<br>**Read: `0x81`**
| Address | Function | Description |
|:-------:|-------------------------|-------------|
| 0x11 | `GRAPHICS_ASSIGN_COLOR` | Assigns a color to one of the 16 color palette slots. Color should be provided in YCbCr format.<br>**Write: `palette_index[7:0]`**<br>**Write: `y[7:0]`**<br>**Write: `cb[7:0]`**<br>**Write: `cr[7:0]`**
| 0x12 | `GRAPHICS_DRAW_SPRITE` | Draws a sprite on the screen. The first two arguments specify an absolute x and y position to print the sprite. The sprite will be printed from its top left corner. The third argument determines the width of the sprite in pixels. The fourth argument determines the number of colors contained in the sprite. This value may be 2, 4, or 16. The final argument specifies the color palette offset for assigning the color values held in the sprite against the stored colors in the palette. Following bytes will then be printed on the background frame buffer.<br>**Write: `x_position[15:0]`**<br>**Write: `y_position[15:0]`**<br>**Write: `width[15:0]`**<br>**Write: `total_colors[7:0]`**<br>**Write: `palette_offset[7:0]`**<br>**Write: `pixel_data[7:0]`**<br>**...**<br>**Write: `pixel_data[7:0]`**<br>
| 0x13 | `GRAPHICS_DRAW_VECTOR` | Draws a cubic Bézier curve from the start position to the end position. Control points 1 and 2 are relative to the start and end positions respectively, and are used to determine the shape of the curve. The final argument determines the color used from the current palette, and can be between 0 and 15.<br>**Write: `x_start_position[15:0]`**<br>**Write: `y_start_position[15:0]`**<br>**Write: `x_end_position[15:0]`**<br>**Write: `y_end_position[15:0]`**<br>**Write: `ctrl_1_x_position[15:0]`**<br>**Write: `ctrl_1_y_position[15:0]`**<br>**Write: `ctrl_2_x_position[15:0]`**<br>**Write: `ctrl_2_y_position[15:0]`**<br>**Write: `color[7:0]`**
| 0x14 | `GRAPHICS_BUFFER_SHOW` | The foreground and background buffers are switched. The new foreground buffer is continuously rendered to the display, and the background buffer can be used to load new draw commands.<br><br>**Note**: It is recommended to verify that the value of bit [1] of `GRAPHICS_BUFFER_STATUS` (`0x18`) is zero, in order to ensure that the previous `GRAPHICS_BUFFER_SHOW` command has been accepted before issuing a new `GRAPHICS_BUFFER_SHOW` command.
| 0x18 | `GRAPHICS_BUFFER_STATUS`| Status of graphics buffer.<br>**Read: `buffer_status[1:0]`**<br>`buffer_status[0]`: Current buffer<br>`buffer_status[1]`: Switch buffer pending
| 0x20 | `CAMERA_CAPTURE` | Starts a new image capture.
| 0x30 | `CAMERA_IMAGE_READY` | Flag indicating that the JPEG compression has been completed. It is recommended to read a 1 twice before reading the image data.<br>**Read: `image_complete[0]`**
| 0x21 | `CAMERA_BYTES_AVAILABLE`| Returns how many bytes are available to read within the capture memory.<br>**Read: `bytes_available[23:0]`**
| 0x31 | `CAMERA_BYTES_TOTAL` | Returns the size of the entropy coded segment of the JPEG data.<br>**Read: `compressed_bytes[15:0]`**
| 0x22 | `CAMERA_READ_BYTES` | Reads a number of bytes from the capture memory.<br>**Read: `data[7:0]`**<br>**...**<br>**Read: `data[7:0]`**
| 0x23 | `CAMERA_RESOLUTION` | Sets the resolution of the image capture in pixels. Captured images are always square, so only one value is required.<br>**Write: `resolution[10:0]`**
| 0x25 | `CAMERA_READ_METERING` | Returns the current brightness levels for the red, green and blue channels of the camera. Two sets of values are returned representing spot and average metering.<br>**Read: `center_red_level[7:0]`**<br>**Read: `center_green_level[7:0]`**<br>**Read: `center_blue_level[7:0]`**<br>**Read: `average_red_level[7:0]`**<br>**Read: `average_green_level[7:0]`**<br>**Read: `average_blue_level[7:0]`**
| 0x26 | `CAMERA_QUALITY_FACTOR` | Sets the Quality Factor (QF) of the saved JPEG image. High values are higher quality but bigger size.<br>**Write: `quality_factor[2:0]`**<br>`0x0` = Lowest quality<br>`0x1`<br>`0x2`<br>`0x3`<br>`0x4`<br>`0x5`<br>`0x6`<br>`0x7` = Highest quality<br>
| 0x28 | `CAMERA_DPHY_POWER_DOWN`| Enables or disables the MIPI D-PHY for power saving when the camera is not needed.<br>**Write: `dphy_power_down[0]`**<br>`0x0` = Normal operation (default)<br>`0x1` = Power down
| 0x32 | `CAMERA_GAMMA_BYPASS` | Bypasses the gamma correction block when enabled. This is needed for factory camera focusing and calibration.<br>**Write: `gamma_bypass[0]`**<br>`0x0` = Normal operation (default)<br>`0x1` = Gamma correction bypassed
| 0x40 | `PLL_CONTROL` | PLL Control Register. Controls PLL power and clock mux of image buffer.<br>**Write: `pll_powerdown_n[0]`**<br>`0x00` = Power down PLL<br>`0x01` = Power on PLL (default)<br>**Write: `image_buffer_clock_sel[1]`**<br>`0x00` = Image buffer clocked from PLL generated clock (default)<br>`0x01` = Image buffer clocked from SPI clock<br>
| 0x41 | `PLL_STATUS` | Status of PLL clock outputs.<br>**Read: `pll_status[0]`**<br>`0x00` = PLL powered down or not stable yet<br>`0x01` = PLL powered on and stable
| 0xDB | `GET_CHIP_ID` | Returns the chip ID value.<br>**Read: `id_value[7:0]`**<br>`0x81` = FPGA running correctly (default)

## Graphics

Expand Down Expand Up @@ -68,10 +73,14 @@ Vectors can be drawn with the `GRAPHICS_DRAW_VECTOR` command. By setting the con

## Camera

The complete pipeline for the camera subsection is as follows:
The complete pipeline for the camera subsystem is as follows:

![Camera pipeline for Frame](diagrams/camera-pipeline-architecture.drawio.png)

And the JPEG encoding subsystem is further broken down as follows:

![JPEG encoding pipeline for Frame](diagrams/camera-jpeg-encoder-architecture-2.drawio.png)

### Capturing Images

TODO
Expand Down
Loading