-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(MiscDrivers,PeriphDrivers,Examples): CSI2/ImgCapture Image Processing Pipeline Rework, New MAX78002 QSPI Example, New RetinaNet Example #583
Conversation
- Working standard reads/writes - Working QSPI reads/writes
- If the value of the dummy byte was defined locally inside of the spi_transmit function, it would introduce some glitches on the SPI MOSI line. Suspected compiler optimization issue. For some reason, these glitches also corrupted the MISO line. This caused RX data to be corrupted, and ram reads would return incorrect values.
…es are corrupted by misaligned IO1)
…n 86us, VGA read in 65us (!!!)
- Working standard reads/writes - Working QSPI reads/writes
- If the value of the dummy byte was defined locally inside of the spi_transmit function, it would introduce some glitches on the SPI MOSI line. Suspected compiler optimization issue. For some reason, these glitches also corrupted the MISO line. This caused RX data to be corrupted, and ram reads would return incorrect values.
…es are corrupted by misaligned IO1)
…n 86us, VGA read in 65us (!!!)
/clang-format-run |
|
||
// Used for Non-DMA CSI2 Cases | ||
static volatile uint32_t bits_per_pixel; | ||
static volatile uint32_t fifo_burst_size; | ||
static volatile mxc_csi2_reva_fifo_trig_t fifo_int_trig; | ||
static volatile mxc_csi2_ahbwait_t ahbwait_en; | ||
|
||
typedef enum { SELECT_A, SELECT_B } lb_sel_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Delete this (unused)
|
||
mxc_csi2_capture_stats_t MXC_CSI2_GetCaptureStats() | ||
{ | ||
mxc_csi2_reva_capture_stats_t stats = MXC_CSI2_RevA_DMA_GetCaptureStats(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just return stats here? Or return the RevA function call? I forget how the casting works for structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mxc_csi2_capture_stats_t MXC_CSI2_GetCaptureStats()
{
mxc_csi2_reva_capture_stats_t stats = MXC_CSI2_RevA_DMA_GetCaptureStats();
return (mxc_csi2_capture_stats_t)stats;
}
Gives
/home/jakecarter/repos/fork/msdk/Libraries/CMSIS/../PeriphDrivers/Source/CSI2/csi2_ai87.c: In function 'MXC_CSI2_GetCaptureStats':
/home/jakecarter/repos/fork/msdk/Libraries/CMSIS/../PeriphDrivers/Source/CSI2/csi2_ai87.c:325:5: error: conversion to non-scalar type requested
325 | return (mxc_csi2_capture_stats_t)stats;
| ^~~~~~
I think we need to return a pointer to do the type cast but I just wanted to return the struct directly.
I'll see if I can clean this up a bit
@@ -67,32 +73,82 @@ | |||
(MXC_F_CSI2_REVA_RX_EINT_VFF_IE_FNEMP_MD | MXC_F_CSI2_REVA_RX_EINT_VFF_IE_FTHD_MD | \ | |||
MXC_F_CSI2_REVA_RX_EINT_VFF_IE_FFUL_MD) | |||
|
|||
// A macro to convert a DMA channel number to an IRQn number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for this PR, but we should add this to all <part_number>.h's
* @brief Interrupt Handler Function. | ||
* @return #E_NO_ERROR if everything is successful. | ||
*/ | ||
int MXC_CSI2_Handler(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the mxc_csi2_line_handler_cb_t supposed to replace this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I wanted to intentionally remove the publicly exposed handler. The drivers are completely interrupt driven from MXC_CSI2_RevAHandler
so there is no option to override the CSI2 IRQ handler (yet).
Overview
This is a big one...
Add APS6404 (external SRAM on the MAX78002EVKIT) drivers.
Refactor CSI2 RevA drivers and MIPI camera API
Add the PascalVOC-RetinaNetv7_3 object detection demo for the MAX78002
Add QSPI example for MAX78002EVKIT
Miscellaneous ImgCapture/README fixes
Related PRs
Model training & synthesis files for PascalVOC-RetinaNet
Tests
RGB565 works at the improved framerate up to 320x320. Beyond that, it works up to 672x514 at reduced framerate.
160x120 (QQVGA) RGB565 (10-15 fps)

320x240 (QVGA) RGB565 (10-15 fps)

320x320 RGB565 (10-15 fps)

640x480 RGB565 (2-3 fps)

RAW8 also works at all the resolutions above. It can push farther up to 800x600 (SVGA) before operation becomes unreliable.
800x600 RAW8 (2-3 fps)

928x768 RAW8 (2-3 fps)
