Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ARM
* [Radxa ROCK 3C](../master/docs/radxa_rock_3c.md)
* [Radxa ROCK 5A](../master/docs/radxa_rock_5a.md)
* [Radxa ROCK 5B](../master/docs/radxa_rock_5b.md)
* [Radxa ROCK 5B+](../master/docs/radxa_rock_5b.md)
Comment on lines 54 to +55
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同一个文件你就这里改链接标题吧

* [Radxa CM5 IO](../master/docs/radxa_cm5_io.md)
* [Rock Pi 4](../master/docs/rockpi4.md)
* [Orange Pi Prime](../master/docs/orange_pi_prime.md)
Expand Down
1 change: 1 addition & 0 deletions docs/index.java.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Specific platform information for supported platforms is documented here:
- @ref radxa_rock_3c
- @ref radxa_rock_5a
- @ref radxa_rock_5b
- @ref radxa_rock_5b+
- @ref rockpi4

## DEBUGGING
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Specific platform information for supported platforms is documented here:
- @ref radxa_rock_3c
- @ref radxa_rock_5a
- @ref radxa_rock_5b
- @ref radxa_rock_5b+
- @ref rockpi4

## DEBUGGING
Expand Down
10 changes: 5 additions & 5 deletions docs/radxa_rock_5b.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Radxa ROCK 5 Model B {#_Radxa}
====================
Radxa ROCK 5B & 5B+ {#_Radxa}
===========================

Radxa ROCK 5 Model B is a Rockchip RK3588 based SBC(Single Board Computer) by Radxa. It can run Android or Linux. Radxa ROCK 5 Model B features a four core ARM processor, 64bit dual channel 5500Mb/s LPDDR5, HDMI up to 8K60fps, MIPI DSI, MIPI CSI, 3.5mm combo audio jack, Wi-Fi 6, Bluetooth 5.0, USB, GbE LAN, and 40-pin color expansion header. Radxa ROCK 5 Model B is powered by the USB Type-C port, and supports 5V input only. The recommended power adapter is 5V/3A without SSD, or 5V/5A with SSD.
Radxa ROCK 5B & 5B+ are Rockchip RK3588 based SBCs (Single Board Computer) made by Radxa. It can run Android or Linux. Radxa ROCK 5B & 5B+ feature a eight core ARM processor, 64bit dual channel 5500Mb/s LPDDR5, HDMI up to 8K60fps, MIPI DSI, MIPI CSI, 3.5mm combo audio jack, USB, ethernet, and 40-pin GPIO header. Radxa ROCK 5B & 5B+ are powered by the USB Type-C port, with 5B+ having 2 power input ports. The recommended power adapter is 5V/3A without SSD, or 5V/5A with SSD.

Interface notes
---------------
Expand All @@ -12,7 +12,7 @@ Interface notes
Pin Mapping
-----------

Radxa ROCK 5 Model B has a 40-pin expansion header. Each pin is distinguished by the color.
Radxa ROCK 5B & 5B+ has a 40-pin expansion header. Pins are color coded.

| Function5| Function4| Function3| Function2| Function1| PIN | PIN | Function1| Function2| Function3| Function4|
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5B+下面不是至少两个引脚都和5B不同么?

|-----------|-------------|-------------|-------------|-----------|:------|------:|----------|-------------|------------|------------|
Expand Down Expand Up @@ -44,4 +44,4 @@ You can find additional product support in the following channels:

- [Product Info](https://docs.radxa.com/en/rock5/rock5b)
- [Forums](https://forum.radxa.com/c/rock5)
- [Github](https://github.com/radxa)
- [Github](https://github.com/radxa)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这改了啥?

1 change: 1 addition & 0 deletions include/arm/radxa_rock_5b.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern "C" {
#define MRAA_RADXA_ROCK_5B_AIO_COUNT 1
#define MRAA_RADXA_ROCK_5B_PIN_COUNT 40
#define PLATFORM_NAME_RADXA_ROCK_5B "Radxa ROCK 5B"
#define PLATFORM_NAME_RADXA_ROCK_5B_PLUS "Radxa ROCK 5B+"

mraa_board_t *
mraa_radxa_rock_5b();
Expand Down
3 changes: 2 additions & 1 deletion src/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ mraa_arm_platform()
platform_type = MRAA_RADXA_ROCK_3C;
else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5A))
platform_type = MRAA_RADXA_ROCK_5A;
else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B))
else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B) ||
mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B_PLUS))
platform_type = MRAA_RADXA_ROCK_5B;
else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_CM5_IO))
platform_type = MRAA_RADXA_CM5_IO;
Expand Down
51 changes: 38 additions & 13 deletions src/arm/radxa_rock_5b.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ mraa_radxa_rock_5b()
b->no_bus_mux = 1;
b->phy_pin_count = MRAA_RADXA_ROCK_5B_PIN_COUNT + 1;

if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B)) {
b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B;
} else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B_PLUS)) {
b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B_PLUS;
} else {
syslog(LOG_ERR, "An unknown product detected. Fail early...");
return NULL;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

free呢?真就同样的问题同样犯?

}

// UART
b->uart_dev_count = MRAA_RADXA_ROCK_5B_UART_COUNT;
b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B;
b->def_uart_dev = 0;
b->uart_dev[0].index = 2;
b->uart_dev[1].index = 3;
Expand All @@ -60,7 +68,7 @@ mraa_radxa_rock_5b()
b->uart_dev[1].device_path = (char*) radxa_rock_5b_serialdev[1];
b->uart_dev[2].device_path = (char*) radxa_rock_5b_serialdev[2];
b->uart_dev[3].device_path = (char*) radxa_rock_5b_serialdev[3];

// I2C
b->i2c_bus_count = MRAA_RADXA_ROCK_5B_I2C_COUNT;
b->def_i2c_bus = 0;
Expand Down Expand Up @@ -108,12 +116,6 @@ mraa_radxa_rock_5b()
b->pins[28].pwm.parent_id = 6; // PWM6_M2
b->pins[28].pwm.mux_total = 0;
b->pins[28].pwm.pinmap = 0;
b->pins[29].pwm.parent_id = 15; // PWM15_M3
b->pins[29].pwm.mux_total = 0;
b->pins[29].pwm.pinmap = 0;
b->pins[31].pwm.parent_id = 13; // PWM13_M2
b->pins[31].pwm.mux_total = 0;
b->pins[31].pwm.pinmap = 0;
b->pins[32].pwm.parent_id = 14; // PWM14_M0
b->pins[32].pwm.mux_total = 0;
b->pins[32].pwm.pinmap = 0;
Expand All @@ -130,6 +132,22 @@ mraa_radxa_rock_5b()
b->pins[38].pwm.mux_total = 0;
b->pins[38].pwm.pinmap = 0;

if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B)) {
b->pins[29].pwm.parent_id = 15; // PWM15_M3
b->pins[29].pwm.mux_total = 0;
b->pins[29].pwm.pinmap = 0;
b->pins[31].pwm.parent_id = 13; // PWM13_M2
b->pins[31].pwm.mux_total = 0;
b->pins[31].pwm.pinmap = 0;
} else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B_PLUS)) {
b->pins[29].pwm.parent_id = 1; // PWM1_M2
b->pins[29].pwm.mux_total = 0;
b->pins[29].pwm.pinmap = 0;
b->pins[31].pwm.parent_id = 0; // PWM0_M2
b->pins[31].pwm.mux_total = 0;
b->pins[31].pwm.pinmap = 0;
}

b->aio_count = MRAA_RADXA_ROCK_5B_AIO_COUNT;
b->adc_raw = 10;
b->adc_supported = 10;
Expand All @@ -152,7 +170,7 @@ mraa_radxa_rock_5b()
mraa_radxa_rock_5b_pininfo(b, 12, 3, 13, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B5");
mraa_radxa_rock_5b_pininfo(b, 13, 3, 15, (mraa_pincapabilities_t){1,1,0,0,1,1,0,0}, "GPIO3_B7");
mraa_radxa_rock_5b_pininfo(b, 14, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND");
mraa_radxa_rock_5b_pininfo(b, 15, 3, 16, (mraa_pincapabilities_t){1,0,0,0,1,1,0,1}, "GPIO3_C0");
mraa_radxa_rock_5b_pininfo(b, 15, 3, 16, (mraa_pincapabilities_t){1,1,0,0,1,1,0,1}, "GPIO3_C0");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥改

mraa_radxa_rock_5b_pininfo(b, 16, 3, 4, (mraa_pincapabilities_t){1,1,0,0,1,0,0,0}, "GPIO3_A4");
mraa_radxa_rock_5b_pininfo(b, 17, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "3V3");
mraa_radxa_rock_5b_pininfo(b, 18, 4, 20, (mraa_pincapabilities_t){1,1,1,0,1,0,0,0}, "GPIO4_C4");
Expand All @@ -166,18 +184,25 @@ mraa_radxa_rock_5b()
mraa_radxa_rock_5b_pininfo(b, 26, 1, 13, (mraa_pincapabilities_t){1,1,0,0,1,0,0,1}, "GPIO1_B5");
mraa_radxa_rock_5b_pininfo(b, 27, 4, 22, (mraa_pincapabilities_t){1,1,1,0,1,1,0,0}, "GPIO4_C6");
mraa_radxa_rock_5b_pininfo(b, 28, 4, 21, (mraa_pincapabilities_t){1,1,1,0,1,1,0,0}, "GPIO4_C5");
mraa_radxa_rock_5b_pininfo(b, 29, 1, 31, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_D7");
mraa_radxa_rock_5b_pininfo(b, 30, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND");
mraa_radxa_rock_5b_pininfo(b, 31, 1, 15, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_B7");
mraa_radxa_rock_5b_pininfo(b, 32, 3, 18, (mraa_pincapabilities_t){1,1,1,0,1,1,0,1}, "GPIO3_C2");
mraa_radxa_rock_5b_pininfo(b, 33, 3, 7, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO3_A7");
mraa_radxa_rock_5b_pininfo(b, 34, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND");
mraa_radxa_rock_5b_pininfo(b, 35, 3, 14, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B6");
mraa_radxa_rock_5b_pininfo(b, 36, 3, 9, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B1");
mraa_radxa_rock_5b_pininfo(b, 37, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,1,0}, "NC");
mraa_radxa_rock_5b_pininfo(b, 36, 3, 9, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B1");
mraa_radxa_rock_5b_pininfo(b, 38, 3, 10, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B2");
mraa_radxa_rock_5b_pininfo(b, 39, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND");
mraa_radxa_rock_5b_pininfo(b, 40, 3, 11, (mraa_pincapabilities_t){1,1,0,0,0,0,0,0}, "GPIO3_B3");

if(b->platform_name == PLATFORM_NAME_RADXA_ROCK_5B) {
mraa_radxa_rock_5b_pininfo(b, 29, 1, 31, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_D7");
mraa_radxa_rock_5b_pininfo(b, 31, 1, 15, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_B7");
mraa_radxa_rock_5b_pininfo(b, 37, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,1,0}, "NC");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5B PIN_37 这里 NC 是因为硬件要么没接出来要么是没贴电阻。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面的pinout和我们文档有更新么?我还是第一次知道这个

} else if(b->platform_name == PLATFORM_NAME_RADXA_ROCK_5B_PLUS) {
mraa_radxa_rock_5b_pininfo(b, 29, 1, 3, (mraa_pincapabilities_t){1,1,1,0,0,1,0,0}, "GPIO1_A3");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PIN_29 PWM1-M2, 板级打开了 PWM1-M0 这里关闭 PWM?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是风扇共用的pwm控制器么?所以现在是开还是关

mraa_radxa_rock_5b_pininfo(b, 31, 1, 2, (mraa_pincapabilities_t){1,1,1,0,0,1,0,0}, "GPIO1_A2");
mraa_radxa_rock_5b_pininfo(b, 37, 0, 0, (mraa_pincapabilities_t){1,1,0,0,0,0,1,0}, "GPIO0_A0");
}

return b;
}
2 changes: 1 addition & 1 deletion src/mraa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ mraa_file_contains(const char* filename, const char* content)
return 0;
}
while ((getline(&line, &len, fh) != -1) && (found == 0)) {
if (strstr(line, content)) {
if (strncmp(line, content, strlen(line)) == 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个函数干的事情完全不一样啊,怎么能改的?

found = 1;
break;
}
Expand Down