基本思想: 记录一下rk3399 pro刷机过程,在公司刷机造成了屏幕卡在firefly画面不动了,甚是焦虑,拿回家拯救搬砖
其中ubuntu的帐号:firefly 密码:firefly
其中Fedroa的帐号:toybrick 密码:toybrick
一、下载官方资料和固件 系统镜像:AIO-RK3399PROC-UBUNTU-20.04_MINIMAL-GPT-20211230-1503.img.7z
1)菜鸡使用sd卡刷机的
2)、然后插上内存卡,重启,重启成功之后,会提醒你拔掉sd卡
3)刷机成功结果
二、另一种方法刷机,在已经安装驱动的基础上,使用RKDevTool工具
2)用了方法一:长按板子上的recovery键,长按的同时给板子供上电,此时可在工具中看到检测到一个loader设备
系统镜像:AIO-RK3399PROC-FEDROA-20200116-1520.img.7z
刷机成功Fedroa系统
三、使用将检测代码和liburl代码结合一下,将检测信息发送出去即可
cmakelists.txt
cmake_minimum_required(VERSION 3.16)
project(demo_curl)
set(CMAKE_CXX_STANDARD 14)
add_executable(demo_curl main.cpp)
target_link_libraries(demo_curl -lcurl )
http发送代码
#include<stdio.h>
#include<curl/curl.h>
int main(int argc, char *argv[])
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "192.168.10.26:8334/api/hello");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "http");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Basic dmNoYXdsYTpIZXJlQDExMTE=");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = const char *data = "{\"praenomen\":\"Gaius\",\"nomen\":\"Julius\",\"cognomen\":\"Caezar\",\"born\":-100,\"died\":-44}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
curl_global_cleanup();
return 0;
}
参考
Loader 升级模式 — Firefly Wiki