Multi Source Translation Content

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multi Source Translation Content

Discussions

Sort by:
TfLite NPU 実行エラー op_layout_inference.cc:MapAxis:177 マップ軸が失敗しました みなさん ごめんなさい。私は、Pythonから変換されたプログラムである独自のC ++プログラムを構築して、私のボードimx8m plusの人々を検出するための簡単なモデルを実行しようとしました。 コード: 1. main.cpp // main.cpp #include "detector.h" #include int main(int argc, char* argv[]) { if (argc != 2) { std::cerr << "Usage: " << argv[0] << " " << std::endl; return 1; } std::string image_path = argv[1]; std::string model_path = "model.tflite"; std::string delegate_path = "/usr/lib/libvx_delegate.so"; cv::Size input_size(192, 192); float score_th = 0.5; float nms_th = 0.4; Detector detector(model_path, delegate_path, input_size, score_th, nms_th); if (!detector.init_model()) { return 1; } cv::Mat image = cv::imread(image_path); if (image.empty()) { std::cerr << "Failed to load image from " << image_path << std::endl; return 1; } auto [bboxes, scores] = detector.detect(image); for (size_t i = 0; i < bboxes.size(); ++i) { cv::rectangle(image, bboxes[i], cv::Scalar(0, 255, 0), 2); std::cout << "Detected bbox: " << bboxes[i] << " with score: " << scores[i] << std::endl; } // cv::imshow("Detections", image); cv::waitKey(0); return 0; } 2. 検出器.h // detector.h #ifndef DETECTOR_H #define DETECTOR_H #include #include #include #include #include #include #include #include "delegate_main.h" class Detector { public: Detector(const std::string& model_path, const std::string& delegate_path, const cv::Size& input_shape, float score_th, float nms_th); bool init_model(); std::pair<:vector><:rect>, std::vector > detect(const cv::Mat& image); private: std::string model_path_; std::string delegate_path_; cv::Size input_shape_; float score_th_; float nms_th_; std::unique_ptr<:interpreter> interpreter_; std::pair<:mat> preprocess(const cv::Mat& image, const cv::Size& input_size); std::tuple<:vector><:rect>, std::vector , std::vector > postprocess(cv::Mat& outputs, const cv::Size& img_size, float ratio, float score_th, float nms_th); void meshgrid(const cv::Range& x_range, const cv::Range& y_range, cv::Mat& xv, cv::Mat& yv); std::tuple<:vector><:rect>, std::vector , std::vector > nms(const std::vector<:rect>& bboxes, const std::vector & scores, float score_th, float nms_th); }; #endif // DETECTOR_H 3. detector.cpp // detector.cpp #include "detector.h" #include Detector::Detector(const std::string& model_path, const std::string& delegate_path, const cv::Size& input_shape, float score_th, float nms_th) : model_path_(model_path), delegate_path_(delegate_path), input_shape_(input_shape), score_th_(score_th), nms_th_(nms_th) {} bool Detector::init_model() { auto model = tflite::FlatBufferModel::BuildFromFile(model_path_.c_str()); if (!model) { std::cerr << "Failed to load model from " << model_path_ << std::endl; return false; } auto ext_delegate_option = TfLiteExternalDelegateOptionsDefault(delegate_path_.c_str()); auto ext_delegate_ptr = TfLiteExternalDelegateCreate(&ext_delegate_option); if (!ext_delegate_ptr) { std::cerr << "Failed to create external delegate" << std::endl; return false; } tflite::ops::builtin::BuiltinOpResolver resolver; resolver.AddCustom(kNbgCustomOp, tflite::ops::custom::Register_VSI_NPU_PRECOMPILED()); tflite::InterpreterBuilder builder(*model, resolver); builder(&interpreter_); if (!interpreter_) { std::cerr << "Failed to build interpreter" << std::endl; return false; } interpreter_->ModifyGraphWithDelegate(ext_delegate_ptr); if (interpreter_->AllocateTensors() != kTfLiteOk) { std::cerr << "Failed to allocate tensors" << std::endl; return false; } return true; } std::pair<:mat> Detector::preprocess(const cv::Mat& image, const cv::Size& input_size) { float ratio = std::min(static_cast (input_size.width) / image.cols, static_cast (input_size.height) / image.rows); cv::Size new_size(static_cast (image.cols * ratio), static_cast (image.rows * ratio)); cv::Mat resized_image; cv::resize(image, resized_image, new_size, 0, 0, cv::INTER_LINEAR); cv::Mat padded_image = cv::Mat::ones(input_size, CV_8UC3) * 114; resized_image.copyTo(padded_image(cv::Rect(0, 0, resized_image.cols, resized_image.rows))); std::vector<:mat> channels(3); cv::split(padded_image, channels); cv::Mat chw_image(3, input_size.height * input_size.width, CV_32F); for(int i = 0; i < 3; ++i) { channels[i].convertTo(channels[i], CV_32F); std::memcpy(chw_image.ptr (i), channels[i].data, channels[i].total() * sizeof(float)); } cv::Mat reshaped_image = chw_image.reshape(1, {1, 3, input_size.height, input_size.width}); return std::make_pair(reshaped_image, ratio); } std::tuple<:vector><:rect>, std::vector , std::vector > Detector::postprocess(cv::Mat& outputs, const cv::Size& img_size, float ratio, float score_th, float nms_th) { std::vector<:rect> bboxes; std::vector scores; std::vector class_ids; std::vector strides = {8, 16, 32}; std::vector<:mat> grids; std::vector<:mat> expanded_strides; for (int stride : strides) { int hsize = img_size.height / stride; int wsize = img_size.width / stride; cv::Mat xv, yv; meshgrid(cv::Range(0, wsize - 1), cv::Range(0, hsize - 1), xv, yv); cv::Mat grid; cv::hconcat(xv.reshape(1, 1), yv.reshape(1, 1), grid); grids.push_back(grid.reshape(2, 1)); expanded_strides.push_back(cv::Mat(grid.size(), CV_32F, cv::Scalar(stride))); } cv::Mat grid_cat, stride_cat; cv::vconcat(grids, grid_cat); cv::vconcat(expanded_strides, stride_cat); outputs.colRange(2, 4).convertTo(outputs.colRange(2, 4), CV_32F); cv::Mat exp_colRange(outputs.colRange(2, 4).size(), CV_32F); cv::exp(outputs.colRange(2, 4), exp_colRange); outputs.colRange(0, 2) = (outputs.colRange(0, 2) + grid_cat) * stride_cat; outputs.colRange(2, 4) = exp_colRange.mul(stride_cat); cv::Mat predictions = outputs.row(0); cv::Mat bboxes_mat = predictions.colRange(0, 4); cv::Mat scores_mat = predictions.col(4).mul(predictions.colRange(5, predictions.cols)); scores.assign(scores_mat.begin (), scores_mat.end ()); std::vector<:rect> bboxes_xyxy(bboxes_mat.rows); for (int i = 0; i < bboxes_mat.rows; ++i) { float x_center = bboxes_mat.at (i, 0); float y_center = bboxes_mat.at (i, 1); float width = bboxes_mat.at (i, 2); float height = bboxes_mat.at (i, 3); float x_min = x_center - width / 2.0; float y_min = y_center - height / 2.0; float x_max = x_center + width / 2.0; float y_max = y_center + height / 2.0; bboxes_xyxy[i] = cv::Rect(cv::Point(x_min / ratio, y_min / ratio), cv::Point(x_max / ratio, y_max / ratio)); } return nms(bboxes_xyxy, scores, score_th, nms_th); } void Detector::meshgrid(const cv::Range& x_range, const cv::Range& y_range, cv::Mat& xv, cv::Mat& yv) { cv::Mat x_coords = cv::Mat(x_range.size(), 1, CV_32F); cv::Mat y_coords = cv::Mat(y_range.size(), 1, CV_32F); for (int i = 0; i < x_range.size(); ++i) { x_coords.at (i,0) = x_range.start + i; } for (int i = 0; i < y_range.size(); ++i) { y_coords.at (i,0) = y_range.start + i; } cv::repeat(x_coords, 1, y_range.size(), xv); cv::repeat(y_coords.t(), x_range.size(), 1, yv); } std::tuple<:vector><:rect>, std::vector , std::vector > Detector::nms(const std::vector<:rect>& bboxes, const std::vector & scores, float score_th, float nms_th) { std::vector<:rect> bboxes_filtered; std::vector scores_filtered; std::vector class_ids_filtered; std::vector indices; cv::dnn::NMSBoxes(bboxes, scores, score_th, nms_th, indices); for(int idx : indices) { bboxes_filtered.push_back(bboxes[idx]); scores_filtered.push_back(scores[idx]); class_ids_filtered.push_back(0); } return std::make_tuple(bboxes_filtered, scores_filtered, class_ids_filtered); } std::pair<:vector><:rect>, std::vector > Detector::detect(const cv::Mat& image) { cv::Mat temp_image = image.clone(); auto [preprocessed_image, ratio] = preprocess(temp_image, input_shape_); std::cout << "Preprocess Completed"<<:endl>tensor(interpreter_->inputs()[0]); const uint input_width = input_data->dims->data[3]; const uint input_height = input_data->dims->data[2]; const uint input_channels = input_data->dims->data[1]; const uint batch_size = input_data->dims->data[0]; std::cout << "Expected dimension: "<< batch_size << "x" << input_channels << "x" << input_height << "x" << input_width << std::endl; const uint image_width = preprocessed_image.size[3]; const uint image_height = preprocessed_image.size[2]; const uint image_channels = preprocessed_image.size[1]; const uint image_batch_size = preprocessed_image.size[0]; std::cout << "Image dimension: "<< image_batch_size << "x" << image_channels << "x" << image_height << "x" << image_width << std::endl; if(input_data->type !=kTfLiteFloat32){ std::cerr << "input tensor is not of type float" << std::endl; return std::make_pair(std::vector<:rect>(), std::vector ()); } if(input_data->data.f == nullptr) { std::cerr << "input tensor data pointer is null" << std::endl; return std::make_pair(std::vector<:rect>(), std::vector ()); } std::memcpy(input_data->data.f, preprocessed_image.ptr (0), batch_size * input_width * input_height * input_channels * sizeof(float)); if(memcmp(input_data->data.f, preprocessed_image.ptr (0),batch_size * input_width * input_height * input_channels * sizeof(float)) != 0){ std::cerr << "data copy to input tensor failed" << std::endl; return std::make_pair(std::vector<:rect>(), std::vector ()); } else{ std::cout << "Set up Input Tensor Completed"<<:endl>Invoke(); std::cout << "Inference Completed"<<:endl>typed_output_tensor (0); size_t output_size = interpreter_->tensor(interpreter_->outputs()[0])->bytes / sizeof(float); cv::Mat results(1, output_size, CV_32F, output_tensor); std::cout << "Get Results Completed"<<:endl> result_rect_list; for (size_t i = 0; i < bboxes_xyxy.size(); ++i) { result_rect_list.push_back(bboxes_xyxy[i]); } // Returning the list of rectangles and the associated scores return {result_rect_list, scores}; } 私のボードイメージはNanbield 6.6.3_1.0.0フルイメージです VX DelegateとNPUを使用して実行しようとしましたが、コードを実行すると問題が発生しました root@imx8mpevk:/run/media/SD CARD-sda1/test_npu# ./detector_app lena_color_512.tif INFO: Vx delegate: allowed_cache_mode set to 0. INFO: Vx delegate: device num set to 0. INFO: Vx delegate: allowed_builtin_code set to 0. INFO: Vx delegate: error_during_init set to 0. INFO: Vx delegate: error_during_prepare set to 0. INFO: Vx delegate: error_during_invoke set to 0. Preprocess Completed Expected dimension: 1x3x192x192 Image dimension: 1x3x192x192 Set up Input Tensor Completed E [/usr/src/debug/tim-vx/1.1.88-r[ 126.612163] audit: type=1701 audit(1695250801.923:18): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=1270 comm="detector_app" exe=2F72756E2F6D656469612F534420434152442D736461312F746573745F6E70752F6465746563746F725F617070 sig=6 res=1 0/src/tim/transform/ops/op_layout_inference.cc:MapAxis:177]Map axis failed. detector_app: /usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc:178: uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector &, uint32_t): Assertion `false' failed. Aborted (core dumped) また、gdb debugを実行しようとしましたが、次のようなものが返されます。 (gdb) set args lena_color_512.tif (gdb) run Starting program: /run/media/SD CARD-sda1/test_npu/detector_app lena_color_512.tif [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". INFO: Vx delegate: allowed_cache_mode set to 0. INFO: Vx delegate: device num set to 0. INFO: Vx delegate: allowed_builtin_code set to 0. INFO: Vx delegate: error_during_init set to 0. INFO: Vx delegate: error_during_prepare set to 0. INFO: Vx delegate: error_during_invoke set to 0. Preprocess Completed Expected dimension: 1x3x192x192 Image dimension: 1x3x192x192 Set up Input Tensor Completed [New Thread 0xfffff146cf00 (LWP 1660)] E [/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc:MapAxis:177]Map axis failed. detector_app: /usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc:178: uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector &, uint32_t): Assertion `false' failed. Thread 1 "detector_app" received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid= , signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 44 pthread_kill.c: No such file or directory. (gdb) bt #0 __pthread_kill_implementation (threadid= , signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x0000fffff69c0568 in __pthread_kill_internal (signo=6, threadid= ) at pthread_kill.c:78 #2 0x0000fffff697acd0 in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.38+git-r0/sysdeps/posix/raise.c:26 #3 0x0000fffff6966ef0 in __GI_abort () at abort.c:79 #4 0x0000fffff69743f8 in __assert_fail_base (fmt=0xfffff6a8a8e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xfffff1ffdcf0 "false", file=file@entry=0xfffff1fff568 "/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc", line=line@entry=178, function=function@entry=0xfffff1fff5d8 "uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector &, uint32_t)") at assert.c:92 #5 0x0000fffff6974470 in __assert_fail (assertion=0xfffff1ffdcf0 "false", file=0xfffff1fff568 "/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc", line=178, function=0xfffff1fff5d8 "uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector &, uint32_t)") at assert.c:101 #6 0x0000fffff1fa5f74 in tim::transform::OpLayoutInfer::MapAxis(std::vector > const&, unsigned int) () from /usr/lib/libtim-vx.so #7 0x0000fffff1f6a1b0 in ?? () from /usr/lib/libtim-vx.so #8 0x0000fffff1f4e5f4 in tim::transform::layout_inference_impl::HandleLayoutInfer(std::shared_ptr<:transform::layout_inference_impl::layoutinfercontext>&, std::shared_ptr<:vx::operation> const&) () from /usr/lib/libtim-vx.so #9 0x0000fffff1f531f4 in tim::transform::LayoutInference(std::shared_ptr<:vx::graph> const&, std::shared_ptr<:vx::context>&, std::map<:shared_ptr><:vx::tensor>, std::shared_ptr<:transform::ipermutevector>, std::less<:shared_ptr><:vx::tensor> >, std::allocator<:pair><:shared_ptr><:vx::tensor> const, std::shared_ptr<:transform::ipermutevector> > > >) () from /usr/lib/libtim-vx.so #10 0x0000fffff23d85ac in vx::delegate::Delegate::Invoke(vx::delegate::OpData const&, TfLiteContext*, TfLiteNode*) () from /usr/lib/libvx_delegate.so #11 0x0000fffff7be9d9c in tflite::Subgraph::InvokeImpl() () from /usr/lib/libtensorflow-lite.so.2.14.0 #12 0x0000fffff7bea388 in tflite::Subgraph::Invoke() () from /usr/lib/libtensorflow-lite.so.2.14.0 #13 0x0000fffff7bd440c in tflite::impl::Interpreter::Invoke() () from /usr/lib/libtensorflow-lite.so.2.14.0 #14 0x0000aaaaaaaa62e0 in Detector::detect (this=this@entry=0xfffffffff890, image=...) at /home/ubuntu/imx-yocto-bsp/sdk/sysroots/armv8a-poky-linux/usr/include/c++/13.2.0/bits/unique_ptr.h:199 #15 0x0000aaaaaaaa35b0 in main (argc= , argv= ) at /home/ubuntu/imx-yocto-bsp/tflite_test/build_minim/main.cpp:29 誰かが何が間違っているのか手がかりを持っていますか?ここで何が起こったのかわからないからです。しかし、私が知っているのは、op_layout_inference.cc:MapAxis:177 Map axisのアサーションがアサーションエラー(? よろしくお願いいたします i.MX 8ファミリ | i.MX 8QuadMax (8QM) | 8QuadPlus Re:TfLite NPU実行エラー op_layout_inference.cc:MapAxis:177マップ軸が失敗しました 問題の原因を見つけました。どうやらこの行がエラーの原因となったようです。 resolver.AddCustom(kNbgCustomOp, tflite::ops::custom::Register_VSI_NPU_PRECOMPILED()); だから今のところ、私はそれを無効にするだけで、魔法のように機能します。誰かがなぜそれがエラーを引き起こすのかを説明できるかもしれませんが、今のところ、私はついに私のアプリ開発を続けることができます。 モデルについては、Pythonコードを使用してチェックしますが、エラーは発生していないようですので、モデル自体はNPUの実行と互換性があります。 ありがとうございます Re:TfLite NPU実行エラー op_layout_inference.cc:MapAxis:177マップ軸が失敗しました モデルが NPU/VX デリゲート実行と互換性がない可能性はありますか? bc CPUで実行しようとすると、別のエラーが発生しました(StridedSliceレイヤーの1つに関連していますが、CPUの実行についてまだ適切にチェックしていません) Re:TfLite NPU実行エラー op_layout_inference.cc:MapAxis:177マップ軸が失敗しました Hello, あなたが知っている限り、ゼロ引数コンストラクタを呼び出すことを不可能にしたという主張は、プライベートであるため、呼び出しが発生した場合、そのアサーションはエラーごとに違反されていると言うためにそこにあるように見えます。 よろしくお願いします。
View full article
探索 MCU-Link Pro 的功能 探索 MCU-Link Pro 的功能 MCU-Link Pro是恩智浦最新的ARM Cortex-M系列核心调试工具。它的一些功能是从过去的LPC-LINK2继承而来的。但总体而言,它经过重新设计并引入了许多新功能。这些附加功能使 MCU-Link Pro 成为一个非常强大的调试工具。本文将探讨这些功能并重点介绍一些有趣且有用的功能。这些功能主要包括以下几个方面。 社工工作+社工工作 电流和功耗的测量 MCU-Link pro 获得新 blhost 支持 适用于 Windows、Ubuntu Linux 和 MacOS 的 LIBUSBSIO 库 板上有辅助芯片LPC804   社工工作+社工工作 MCU-Link Pro 仅支持 SWD。它不支持JTAG。开发板的主控制器是LPC55S69。端口和LPC55S69之间有电平转换电路。使得电路板可以调试目标板在1.2V至5V下工作。它具有参考电压跟踪电路,用于跟踪目标板电压。它可以自动跟踪端口,无需任何设置。MCU-Link Pro 还可以提供 1.8V/3.3V到目标板。最大电流为350mA。这是通过连接 J6 并通过 J5 选择来完成的。 SWO的最大速度为9.6Mbit/s。 与 电流和功耗的测量 MCU-Link pro提供了非常有趣的电流和电压测量实时功能。它可以以高达 100ksps 的速度捕获目标电流使用情况、目标电源电压、屏蔽电流、模拟输入、调试接口参考电压或目标功耗的突发样本。该信息以图表形式显示,也可以导出以供进一步分析。还可以显示所收集数据的平均值。并且根据电流和电压数据,还可以计算出功耗并以图表形式显示。下图中画红线的地方就是鼠标所在时间点的实时电压。 更有趣的是,能量测量功能不需要激活调试来捕获数据,它是离线的,并且具有单独的数据通道。但如果存在这样的调试会话,它也可以链接到会话。这对于调试各种低功耗应用非常有用。不仅可以看到每一步命令下的功耗变化,还可以查看系统运行时较长一段时间内的功耗变化规律。由于有单独的数据通道,您甚至可以在 KEIL 中调试程序并在 MCUXpresso 中观察当前的变化。 MCU Link Pro 有两种电流测量配置,每种配置都有一个最大可测量电流。这是为了针对各种不同的目标实现最高的测量精度。每种配置都有两个自动控制范围,以提供更高的精度。从低电流测量到高电流测量的自动切换完全由硬件控制。 每次 MCU Link Pro 通电时,测量电路都会自行校准。由于使用晶体管将传感电路与目标电源隔离以避免争用并确保在校准期间向系统施加已知电压,因此校准前无需断开/重新连接 MCU Link Pro。 在高采样率下,MCUXpresso IDE 可能无法捕获所有数据,因此可能需要使用工具中的能量测量配置设置中的配置选项来调整采样率。 如果目标电流超过所选范围内的最大电流,测量将会饱和并截止,因此不准确。 Blhost 和 MCU-Link Pro MCU Link Pro最值得关注的是其USB转SPI和I2C桥接功能。这使得计算机能够直接通过 USB 发送 I2C 和 SPI 信号。 blhost也没有忽视这个强大的功能。新版本的blhost可以支持该功能,并增加了新的命令参数‘-L’。具体来说,“- L SPI”指的是SPI接口,“- L I2C”指的是I2C接口。下图是在frdm-k64f上的测试结果。图中可以清楚看到MCU Link Pro的SPI接口可以与k64上的mcuboot固件进行通信,将加密程序下载到flash中。 除了KINETIS,这个功能最适合i.MXRT600和i.MXRT500。这两款芯片都支持串行ISP模式,可以通过SPI或者I2C口把程序下载到RAM中,然后直接运行,很多用户都有这种用法。之前SDK里的例子中,需要用到一块twr-kv46或者twr-k65或者frdm-kl25的板子,用来接收UART的命令和数据,并转换成SPI和I2C的命令。由于这些板子没有直接的接口,需要飞线,非常麻烦。而且NXP只提供了这三块板子的固件,如果要用其他芯片或者板子,也必须移植固件,也非常麻烦。但是有了MCU Link Pro,一切都变得非常轻松愉快。 LIBUSBSIO 库 为了更好地扩展桥接功能的使用,NXP提供了libusbsio库。通过调用此库,您可以在自己的应用程序中实现USB转SPI\I2C\GPIO的功能。还根据NXP提供的libusbsio库制作了烧写kinetis ezport和flash的上位机工具。我在上一篇文章中详细介绍了这一点。有兴趣的朋友可以看看我的文章。 提供基于windows和linux的库是不够的。NXP 还提供了一个 python 库。该库基于python3,可以通过以下命令安装 >pip 安装 libusbsio libusbsio 文档中没有详细描述它的用法。这里做一个大概的介绍。以下是libusbsio的初始化过程。 import logging import logging.config from libusbsio import * # enable basic console logging logging.basicConfig() # load DLL from default directory sio = LIBUSBSIO(loglevel=logging.DEBUG) # the main code # calling GetNumPorts is mandatory as it also scans for all connected USBSIO devices numports = sio.GetNumPorts() print("SIO ports = %d" % numports) if numports > 0 and sio.Open(0): print("LIB version = '%s'" % sio.GetVersion()) print("SPI ports = %d" % sio.GetNumSPIPorts()) print("Max data size = %d" % sio.GetMaxDataSize()) if(sio.GetNumSPIPorts() > 0): spi = sio.SPI_Open(1000000, portNum=0, dataSize=8, preDelay=100) if spi: data, ret = spi.Transfer(spi_ssel[0], spi_ssel[1], b"Hello World") sio.Close() else: print("No USBSIO device found") ​ 第9行是打开libusbsio库的实例; 第14行:获取所有USB桥接器的usbsio端口数量; 第18、19、20行分别是读取的版本信息、SPI端口数量以及SPI缓存的最大大小; 第22行:打开SPI接口; 第24行,开始传输数据。 从上面可以看出使用过程比较简单。并且这些命令与C语言库的命令非常相似。 板上有一个辅助控制器 LPC804 MCU Link Pro 板上还有一个 lpc804。这个芯片在这里很令人困惑。它是用来做什么的?其UART、SPI、I2C端口均连接外部使用。但这有什么用呢?一种可以想象的应用是,UART端口连接到新添加的vcom2,然后SPI或I2C以从属模式工作。它作为监听器,监听需要调试的SPI或者I2C总线,并显示在计算机终端上。 LPC804调试接口与MCU Link Pro的调试端口相同。也许该板本身就是一个开发板,以便用户可以开发lpc804程序?另外,它的UART-ISP端口连接到LPC55S69的UART端口。看来以后可以通过新版本的CMSIS-DAP固件互相通信了。让我们期待未来新的玩法。 Freedom开发平台
View full article
i.MX8QM 音频 mclk 未启用 Hello, 我有一块带有 i.MX8QM 的定制板,我注意到 mclk0 输出未启用。这在 Linux 5.15 上运行良好,但现在我升级到 Linux 6.1 后,mclk0 不再工作。请参阅下面的时钟摘要...时钟频率是正确的,但未启用。如何启用 mclk? cat /sys/kernel/debug/clk/clk_summary enable prepare protect duty hardware clock count count count rate accuracy phase cycle enable ------------------------------------------------------------------------------------------------------- audio_rec_clk0_clk 0 0 0 24576000 0 0 50000 Y aud_rec_clk0_lpcg_clk 0 0 0 24576000 0 0 50000 ? acm_aud_clk0_sel 0 0 0 24576000 0 0 50000 Y acm_aud_clk1_sel 0 0 0 24576000 0 0 50000 Y acm_mclkout0_sel 0 0 0 24576000 0 0 50000 Y mclkout0_lpcg_clk 0 0 0 24576000 0 0 50000 ? acm_mclkout1_sel 0 0 0 24576000 0 0 50000 Y mclkout1_lpcg_clk 0 0 0 24576000 0 0 50000 ? 设备树: sound_card: sound-card { compatible = "simple-audio-card"; simple-audio-card,name = "PCM3168A"; simple-audio-card,aux-devs = <&>; simple-audio-card,widgets = "Speaker", "Channel1out", "Speaker", "Channel2out", "Speaker", "Channel3out", "Speaker", "Channel4out", "Speaker", "Channel5out", "Speaker", "Channel6out", "Speaker", "Channel7out", "Speaker", "Channel8out", "Microphone", "Channel1in", "Microphone", "Channel2in", "Line", "Channel3in", "Line", "Channel4in", "Microphone", "Channel5in", "Microphone", "Channel6in"; simple-audio-card,routing = "Channel1out", "AOUT1L", "Channel2out", "AOUT1R", "Channel3out", "AOUT2L", "Channel4out", "AOUT2R", "Channel5out", "AOUT3L", "Channel6out", "AOUT3R", "Channel7out", "AOUT4L", "Channel8out", "AOUT4R", "Channel1in", "AIN1L", "Channel2in", "AIN1R", "Channel3in", "AIN2L", "Channel4in", "AIN2R", "Channel5in", "AIN3L", "Channel6in", "AIN3R"; simple-audio-card,dai-link@0 { format = "left_j"; bitclock-master = <&snd_cpu>; frame-master = <&snd_cpu>; mclk-fs = <512>; snd_cpu: cpu { sound-dai = <&sai0>; clocks = <&mclkout0_lpcg 0>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; }; pcm3168_dac: codec { sound-dai = <&pcm3168a 0>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; }; }; simple-audio-card,dai-link@2 { format = "left_j"; bitclock-master = <&mic_cpu>; frame-master = <&mic_cpu>; mclk-fs = <512>; mic_cpu: cpu { sound-dai = <&sai0>; clocks = <&mclkout0_lpcg 0>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; }; pcm3168_adc: codec { sound-dai = <&pcm3168a 1>; dai-tdm-slot-num = <8>; dai-tdm-slot-width = <32>; }; }; }; &sai0 { #sound-dai-cells = <0>; assigned-clocks = <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL>, <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS>, <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS>, <&sai0_lpcg 0>; assigned-clock-rates = <786432000>, <49152000>, <12288000>, <49152000>; clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai0>; status = "okay"; }; &i2c0 { #address-cells = <1>; #size-cells = <0>; clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c0>; status = "okay"; // Audio Codec (8-channel output, 6-channel input) pcm3168a: audio-codec@44 { compatible = "ti,pcm3168a"; reg = <0x44>; reset-gpios = <&lsio_gpio4 24 GPIO_ACTIVE_LOW>; clocks = <&mclkout0_lpcg 0>; clock-names = "scki"; clock-frequency = <24576000>; assigned-clocks = <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL>, <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS>, <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS>, <&mclkout0_lpcg 0>; assigned-clock-rates = <786432000>, <49152000>, <24576000>, <49152000>; #sound-dai-cells = <1>; VDD1-supply = <&reg_3v3>; VDD2-supply = <&reg_3v3>; VCCAD1-supply = <&reg_5v0>; VCCAD2-supply = <&reg_5v0>; VCCDA1-supply = <&reg_5v0>; VCCDA2-supply = <&reg_5v0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_codec_clk &pinctrl_audio_reset>; }; }; pinctrl_codec_clk: codec_clk { fsl,pins = < IMX8QM_MCLK_OUT0_AUD_ACM_MCLK_OUT0 0xc0000020 >; }; 回复:i.MX8QM 音频 mclk 未启用 我明白了问题所在。在音频放大器节点中,我在 6.1 内核中设置不正确,导致它无法工作。奇怪的是,dmesg 中没有错误,但是在修复这个错误配置后,mclk 开始工作。感谢您的帮助! 回复:i.MX8QM 音频 mclk 未启用 Hi @joanxie, 以下是 5.15 版时钟和 dmesg 的输出: root@neuralplex:~# cat /sys/kernel/debug/clk/clk_summary enable prepare protect duty hardware clock count count count rate accuracy phase cycle enable ------------------------------------------------------------------------------------------------------- audio_rec_clk0_clk 1 1 0 24576000 0 0 50000 Y aud_rec_clk0_lpcg_clk 1 1 0 24576000 0 0 50000 ? acm_aud_clk0_sel 0 0 0 24576000 0 0 50000 Y acm_aud_clk1_sel 0 0 0 24576000 0 0 50000 Y acm_mclkout0_sel 1 1 0 24576000 0 0 50000 Y mclkout0_lpcg_clk 1 1 0 24576000 0 0 50000 ? acm_mclkout1_sel 0 0 0 24576000 0 0 50000 Y mclkout1_lpcg_clk 0 0 0 24576000 0 0 50000 ? 回复:i.MX8QM 音频 mclk 未启用 谢谢你的信息,你介意分享一下 5.15 bsp 的转储时钟和日志文件吗?让我再确认一下。 回复:i.MX8QM 音频 mclk 未启用 Hi @joanxie, 没错。在 5.15 上运行的相同设备树在 6.1 上无法运行。由于兼容性(主要是 pcie),6.1 设备树中有细微的变化,但除此之外,设备树基本相同。我已附上 dmesg 的输出。 回复:i.MX8QM 音频 mclk 未启用 相同的设备树在 5.15 上运行,但在 6.1 上失败?你介意分享你的日志文件吗?
View full article
FreeMASTER - 使用方法 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 在这里您可以找到有关 FreeMASTER 工具主要功能的简短而重点的介绍。 它是实时数据可视化和MCU实时控制非常有用的工具。 您可以为您的应用程序创建一些非常有趣的 Web 界面 - 观看此视频以了解更多信息。 如果您有任何意见或问题 - 请在下方留言。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 在这里您可以找到有关 FreeMASTER 工具主要功能的简短而重点的介绍。 它是实时数据可视化和MCU实时控制非常有用的工具。 您可以为您的应用程序创建一些非常有趣的 Web 界面 - 观看此视频以了解更多信息。 视频链接:7933 如果您有任何意见或问题 - 请在下方留言。 提示与技巧 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嘿petrfajmon-b17364 , 这是我正在使用的示例文件夹 - 让我向您展示我是如何使用该示例的,然后我将提供有关软件版本等的一些详细信息。不幸的是,商业 Matlab 许可证的价格为 2,150 美元 - 因此在测试期间读取一些变量有点过头了。 我会尝试一下 JavaScript - 但令人失望的是,这个例子不起作用,因为它可以*轻松*地适应我的需求 - 而且我想其他人也可以在开发阶段使用 FreeMASTER 进行这种类型的测试。 首先,我打开了 FreeMASTER 2.0 - 我已经通过 CAN 和 UART 成功与目标通信,因此没有问题。此时我只是打开了应用程序,并没有与目标进行通信。 然后,我从此位置打开 Excel 示例( c:\NXP\FreeMASTER_Serial_Communication_Driver_V2.0\examples\ActiveX_examples\Excel) :   打开 Excel 电子表格,我显然点击了“启用宏”,然后进入 VBA 查看示例(与用户手册相同): 从这里,我点击“调试->编译 VBA 项目”,出现了之前的 ActiveX 错误: 在此对话框中点击“调试”会将我指向此行,表明它无法创建“McbPcm”实例 进入“工具->参考”验证示例中是否存在正确的服务: 就软件版本而言,我正在使用: FreeMASTER 版本 2.0.3.1 Microsoft Excel 2013(15.0.4667.1000) VBA 版本 7.1 DirectX 版本 11 FreeMASTER 2.0 手册显示此处的 Excel 示例中使用的是 1.3 版本: 请让我知道为什么该示例无法创建对象 - 我应该能够调整其余部分。 谢谢! 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好, gearhead1107 , 您可以查看 FreeMASTER SCI 驱动程序安装位置“c:\NXP\FreeMASTER_Serial_Communication_Driver_V2.0\examples\ActiveX_examples”文件夹中的简单 ActiveX 脚本示例。在我看来,Matlab 是记录诸如“温度”等数据的好工具。Matlab/Excel 示例脚本与 PC 端的演示应用程序(存储在“c:\NXP\FreeMASTER_Serial_Communication_Driver_V2.0\examples\PC_host_demo”中)以及 c:\NXP\FreeMASTER_Serial_Communication_Driver_V2.0\examples\SCI_driver_examples”中)配合使用。 您还提到用户手册引用了旧版本 FreeMASTER v1.3,您能否将旧版本 1.3 的引用详细信息发送给我? 谢谢! 彼得 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好, gearhead1107 , 没有专门针对 FreeMASTER 相关主题的社区 - 所以您可以将其留在这里。 就我个人而言,我只尝试了 HTML 和 JS。也许您可以只使用 JS 并使用您需要的数据创建一个 xls。 petrfajmon-b17364‌ 您能推荐一位有此类技术经验的人吗? 非常感谢! Daniel 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> dumitru-daniel.popa ‌,谢谢指点! 我认为通过 VBA/Excel 使用 ActiveX 控件是完成我想做的事情的最佳方式(即获取值->放入电子表格进行日志记录),但包含的示例甚至无法编译。查看用户手册,似乎他们甚至引用了旧版本的 FreeMASTER (v1.3),因此不清楚人们多久会查看一次这些内容。 我目前在“Set fmstr = New McbPcm”行上看到以下错误 - 表明它无法初始化 ActiveX 对象(是的,该项目已根据手册正确定义引用)。是否有关于如何创建对象并针对不同的通信方法(如 CAN)对其进行操作的指南/帮助文章?用户手册介绍了不同的*方法*,但对于推荐用法的介绍却很简短。   由于这是一个 FreeMASTER/ActiveX 问题,我不太确定将其放在哪里 - 我应该在 S32DS 部分发布一些内容吗?或者有 FreeMASTER 社区页面吗? 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好, gearhead1107 , 您可以使用 HTML 或 JScript 功能读取您感兴趣的变量,然后将其写入主机 PC 上的 log/txt 文件中。请查看 Freemaster 用户手册第 6 章:HTML 和脚本。 Freemaster 支持 ActiveX 组件,让基于脚本的代码访问和控制目标板应用程序。 您还可以观看此视频: https://community.nxp.com/thread/455228了解如何使用 jscript(简短续集) 希望这有帮助! Daniel 回复:FreeMASTER-如何 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 在较长时间内将值记录到 PC 的最佳方法是什么? 我正在使用 S32K144,并且添加了“温度”之类的变量,虽然我可以在示波器中观察它们,但我想创建一个日志文件(.CSV 或类似文件),以便我可以对电路板进行测试,并让 Freemaster 在测试过程中记录温度,这可能会持续几个小时。例如,我需要能够返回,查看日志/文件并查看“好的,我们在 X 时间和 Y 温度下失去通信”。 我的第一个想法是设置一个“记录器”,但是 FreeMASTER 说没有空间,而且我也不确定目标上是否有足够的空间来存储日志 - 我只想在 PC 上进行此操作。
View full article
2013年フリースケールカップUSA東海岸結果 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 東海岸のチームとUCバークレーの皆さん、アメリカで総合最速の車におめでとうと言いたいです! イベントのその他の写真/ビデオ。 ウェスト対東の勝者:ジョルト - UC-Berekley 17:35 東海岸チーム: 1位:相対論的ロボットレーサー-ロードアイランド大学-22.04秒 2位:バルカー - ペンシルベニア州立カリフォルニア大学 - 25.15秒 3位:テンプルメイド-テンプル大学-25.72秒 完全な結果を見る フリースケール・カップの内容 イメージギャラリー 日時:2013年フリースケールカップUSA東海岸結果 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> TFC - USA 教員ポータル TFC - メキシコ TFC - EMEA 日時:2013年フリースケールカップUSA東海岸結果 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 素晴らしい! 投稿していただきありがとうございます!! 日時:2013年フリースケールカップUSA東海岸結果 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> フリースケールカップアメリカ東海岸地域大会 2013 - YouTube
View full article
電動バイク向け3相ホール・センサPMSMドライバとKE02ベースのHVモータ向けセンサレス・ソリューション 形容 ブロック図 製品 関連ドキュメント トレーニング コミュニティからの関連デモ 形容 電気モーターと充電式バッテリーを内蔵した自転車で、スマートシティに最適な環境に優しいゼロエミッション車です。E-Bikeの重要な特徴は、信頼性が高く、長期間使用できる必要があることです。 ブロック図 プロダクツ カテゴリー名1: マイクロコントローラ 商品1 URL 1 https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/ke-series-cortex-m4-m0-plus/kinetis-ke02-20-mhz-entry-level-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KE02 商品1 商品説明 1 Kinetis KE02には、特定のフラッシュ・メモリ・サイズとピン数を備えたアナログ、通信、タイミング、制御ペリフェラルの強力なアレイが含まれています。K02は、1つの6チャネルFlexTimer/PWMと2つの2チャネルFlexTimer/PWMを備えた、低電力、高堅牢性、およびコスト効率の高いマイクロコントローラとして機能します。 商品 2 URL 1 ® アームコーテックス®-M4|Kinetis® K64 120MHz 32ビット・マイクロコントローラ |NXPの  商品2 説明1 Arm ® Cortex-M4 ® コア をベースとする KinetisK64-120MHz ® 、256KB SRAM マイクロコントローラ (MCU) カテゴリー名2: ゲート・ドライバ 商品1 URL 1 https://www.nxp.com/products/power-management/motor-and-solenoid-drivers/bldc-h-bridge-stepper/3-phase-brushless-motor-pre-driver:GD3000 商品1 商品説明 1 GD3000は、三相モーター駆動アプリケーション向けゲート・ドライバICです。3つのハーフブリッジ・ドライバを搭載しており、各ハーフブリッジ・ドライバはそれぞれ2つのNチャネルMOSFETを駆動することができます。 カテゴリ名3: LEDドライバ 製品URL 1 https://www.nxp.com/products/power-management/lighting-driver-and-controller-ics/ic-led-controllers/16-channel-fm-plus-ic-bus-57-ma-20-v-constant-current-led-driver:PCA9955BTW 製品説明1 PCA9955Bは、I2Cバス制御の16チャネル定電流LEDドライバで、アミューズメント製品で使用される57 mAの赤/緑/青/アンバー (RGBA) LEDの調光および点滅用に最適化されています。 各LED出力は、31.25 kHzで動作する8ビット分解能(256ステップ)の固定周波数PWMコントローラを個別に使用し、0%~100%に調整可能なデューティ・サイクルによりLEDを特定の輝度に設定できます。 カテゴリー名4: ロジックUSB Type-C設定チャンネル 製品URL 1 https://www.nxp.com/products/interfaces/usb-interfaces/usb-type-c-true-plugn-play/usb-pd-phy-and-cc-logic/cc-logic-for-usb-type-c-applications:PTN5150 製品説明1 PTN5150は、Configuration Channel(CC)制御ロジック検出および表示機能を備えたUSB Type-Cコネクタアプリケーションをサポートする、小型で薄型、低電力のCCロジックチップです。このPTN5150により、USB Type-CコネクタをType-Cケーブルのホスト側とデバイス側の両方で使用できます カテゴリー名5: 電流制限パワースイッチ 製品URL 1 https://www.nxp.com/products/power-management/load-switches/usb-pd-and-type-c-current-limited-power-switch:NX5P3290UK 製品説明1 このNX5P3290には、低電圧ロックアウト、過熱保護、および障害状態が発生したときにスイッチ端子を自動的に絶縁する逆電流保護回路が含まれています。 カテゴリー名6: セキュア 商品1 URL 1 A71CH型 |IoTのためのプラグ&トラスト |NXPの  製品説明1 プラグ&トラスト - 安全なIoT接続を迅速かつ簡単に導入 カテゴリー名7: NFC 商品1 URL 1 PN5180 |NFCフォーラムに完全準拠したフロントエンドIC |NXPの  製品説明1 NFCフォーラム完全準拠のフロントエンドIC カテゴリー名8: 汎用I/Oエクスパンダ 商品1 URL 1 PCAL6534 |レベル変換GPIOエキスパンダー |NXPの  製品説明1 超低電圧、レベル変換、34ビットI2Cバス/SMBus I/Oエキスパンダ   カテゴリー名8: NFCスマートカード 商品1 URL 1 https://www.nxp.com/products/rfid-nfc/mifare-hf/mifare-desfire/mifare-desfire-ev2:MIFARE_DESFIRE_EV2_2K_8K 製品説明1 スマートシティアプリケーション向けの強化された機能セットを備えたセキュアな非接触マルチアプリケーションIC 関連ドキュメント Document URL タイトル https://www.nxp.com/docs/en/application-note/AN10439.pdf ウェハレベルチップスケールパッケージ https://www.nxp.com/docs/en/application-note/AN5322.pdf AN5322、TPMSホイールの位置紹介と主なコンセプト 訓練 トレーニングURL https://community.nxp.com/docs/DOC-341509 コミュニティからの関連デモ URL Kinetisマイクロコントローラ  MCUXpresso SDK  MCUXpressoソフトウェアとツール  Kinetis KV5x Cortex-M7マイクロコントローラおよびGD3000モータ・プリドライバによるUAV速度制御    ブロック図 スマートシティ
View full article
エラー L1102: アドレス 0xE3BFE7 のセグメント PAGE_E3 の割り振りスペースが不足しています コードの小さなセグメントを1つのファイルに追加しようとすると、次のエラーが発生しますが、そのコードセグメントを別のファイルに移動すると完全に機能します。エラーの原因となっているコードが割り当てられたPAGE_E3スペースをオーバーフローさせているようで、それを修正する方法がよくわかりません。PAGE_E4に割り当てられたスペースを減らしながら、PAGE_E3に割り当てられたサイズを増やそうとしましたが、同じメモリアドレスを指し示す同じエラーが発生します。 これは、既存のコードに追加したコード セグメントです。 UI32 tempArry[10] = {0}; for (int i = 0; i < 10; i++) {      tempArry[i] = i; } 次の質問があります: 1. ファイル間でコード セグメントを移動すると、両方のコードが既定の領域にあるように見えるため、動作が変わるのはなぜですか? 2. 他のページに干渉せずにPAGE_E3スペースを増やすにはどうすればよいですか? 3. 特定のコード セグメントを別のPAGE_XXに配置し、ファイルの残りの部分を別のページに保持する特別なアプローチはありますか?その場合、パフォーマンスにはどのような影響がありますか? MC9S12XDP512(R3.prm)のリンカーパラメータファイルが添付されています:参考までに R3.zip。 私はかなり新しいので、問題を理解するためにあなたの助けに感謝します... 感謝 マドゥシャン PS:次のようにしてページをマージしようとしましたが、それでも同じエラーが発生しました。 セグメント /* PAGE_E3 = READ_ONLY 0xE30000 TO 0xE3BFFF; PAGE_E4 = READ_ONLY 0xE48000 TO 0xE4BFFF; */ PAGE_E3E4 = READ_ONLY 0xE30000 TO 0xE4BFFF; 配置 VIRTUAL_TABLE_SEGMENT, /* C++ 仮想テーブル セグメント */ STRINGS, /* 文字列リテラル */ DATA_ROM、 DEFAULT_ROM、 CONST_EVENTS、 CONST_DATA、 ROM_POINTERS、 COPY /* 情報のコピーダウン: 変数の初期化方法 */ PAGE_FE、PAGE_FC、PAGE_FB、PAGE_FA、 PAGE_F9、PAGE_F8、PAGE_F7、PAGE_F6、 /*PAGE_F5、PAGE_F4、PAGE_F3、PAGE_F2、*/ PAGE_F5、 PAGE_E3E4、PAGE_F2、 PAGE_ED、PAGE_EC、PAGE_EB、PAGE_EA、                               PAGE_E9, PAGE_E8, PAGE_E7, PAGE_E6; Re:エラーL1102:アドレス0xE3BFE7のセグメントPAGE_E3の割り当てスペースが不足しています 私は自分で問題を解決したでしょう:ビルドには2つのprmファイルが関与しており、私は1つのファイルしか変更していません...:)。両方のファイルを変更すれば、正常にビルドできたでしょう。 Re:エラーL1102:アドレス0xE3BFE7のセグメントPAGE_E3の割り当てスペースが不足しています 何か助けはありますか@ZhangJennie ?
View full article
Qt5 QPainter 与 QML 和场景图。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 使用 Qt5,您会发现新增的技术将使您的开发变得更加容易。 Qtquick2 场景图 质量 Qt5 向后兼容,这意味着您可以运行 Qt 4.8 应用程序,但这并不意味着它们将具有最佳性能,有时最好进行移植以使用最新的功能。 Qt5,有两种选项可以将组件绘制到屏幕上。Qt 5 中的绘画主要通过以下方式完成: 命令式 QPainter API Qt 的声明性 UI 语言QML及其场景图后端。 QPainter 正如本文档提到的Qt5GraphicsOverview | Qt Wiki | Qt Project Qpainter 引擎使用软件进行绘画,并在绘制 Qimages 或 Qwidgets 时使用。它相对于 OpenGL 的优势在于启用抗锯齿功能时的高质量以及完整的功能集。 Qpainter 可以使用 OpenGL 引擎,但正如文档中提到的,它更容易受到状态变化的影响。并且必须小心使用。 QML 和场景图。 所有可视化 QML 项目均使用场景图进行渲染,场景图是一种低级、高性能渲染堆栈,与 OpenGL 紧密相关。 Qt Quick 2 使用基于 OpenGL ES 2.0 或 OpenGL 2.0 的专用场景图进行渲染。使用场景图进行图形处理,而非传统的命令式绘画系统(QPainter等),意味着待渲染的场景可以在帧之间保留,并且在渲染开始之前即可知道要渲染的完整图元集合。这为一系列优化提供了可能,例如批量渲染以最大限度地减少状态变化,以及丢弃被遮挡的图元。 QML 场景 图 是 Qt 5 中 QML 的新后端 ,它基于 OpenGL。 与 Qt 4 中使用的基于 QPainter 的后端相比,它总体上显著 提高了 QML 的性能。它通过多种方式实现了更佳的性能: 场景图直接使用 OpenGL,而不是通过可以使用光栅或 OpenGL 绘画引擎的 QPainter。这意味着所有资源(如几何体、纹理和着色器)都可以以适合 OpenGL 的格式存储,而不是使用 QPainterPath、QPixmap、QBrush 或 QPen 等类,QPainter 需要将这些类转换为 OpenGL 原语并可能进行缓存。 QML是一种声明性语言,它定义了最终结果应该是什么样的,但它并没有定义如何以及以何种顺序绘制每个单独的元素。因此,可以重新排序绘图以减少状态变化的次数,或者合并绘图以减少绘图调用的次数。 场景图使用单独的渲染线程,并在支持此功能的平台上将动画与垂直回扫同步。渲染线程允许在渲染当前帧的同时准备下一帧。这对单核系统也有积极的影响,因为渲染线程可能会阻塞 OpenGL 命令。与垂直回扫的同步提高了动画的感知平滑度。 我们已经在 i.MX6 上测试了这两个选项,使用 QML Qtquick2 元素获得了最佳效果。当我们尝试通过 Widgets 使用 QtPainter 时,我们面临的问题是,如果不使用像 X11 或 Wayland 这样的窗口系统,画家将无法正常工作并且只会显示 QtGLWidget。 使用 QML 场景图,我们可以在同一个环境中拥有一个 OpenGL 元素和一个 Qt 元素,并且可以轻松地相互通信和共享变量。请在此处查看示例结果: I.MX6 场景图 Qt5 - YouTube 最大的优势是,sceneGraph 全部通过 OpenGL 加速。 回复:Qt5 QPainter 与 QML 和场景图。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好 我正在将一个大型应用程序移植到带有 Qt5.1 的 iMX6,该应用程序最初基于 Qt4.7 并在 iMX35 上运行。 我的旧应用程序有很多基于 QPainter API 的 2D 绘图。 我希望用 QGLWidget 替换 QWidget 并获得硬件加速的 QPainter API;但看起来情况并非如此。 我继续使用 QPainter,但只获得像 Qt 4.7 那样的软件渲染 如果我想要硬件加速 2D 渲染,那么我必须使用 gl API 重写所有绘图代码。 我的理解正确吗? Fabio 回复:Qt5 QPainter 与 QML 和场景图。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> FranciscoCarrillo ,您能否将此文档移至公共 i.MX 社区,以便那里的文档不会指向外部成员无法访问的地方的文档?然后在下面的公开讨论中添加一个帖子来报告这个问题? 链接文章称“访问此地点或内容受到限制...” 此问题尚未回答。 (标记为假定已回答)      stephenlangstaff 2013年7月12日 上午2:43 我看到“对此地点或内容的访问受到限制。如果您认为这是一个错误,请联系您的管理员或引导您到这里的人。”当尝试访问https://community.freescale.com/docs/DOC-94234时,指出EGLFS 上的 QT5 Demo 错误。 谢谢。 授予
View full article
LPC55S69に基づくMCU用の幅広い自動調整電力測定ソリューション 電力測定ボードには、8つのプログラマブル・ゲイン・アンプ(LTC6915)と2つのADCコンバータ(AD7175)をサポートする8つの測定チャンネルが含まれています。測定ボードは、サンプリング抵抗の両端の電圧降下を測定し、電圧降下がアンプによって処理された後、ADCに送信し、SPIを介して利用できるようにします。マイコンLPC55S69は、測定回路からデータを収集し、USB VCOMポートを介してホストコンピュータに送信します。MCUは、異なる電源回路を測定するときに、SPIによってプログラマブルゲインアンプのゲイン値を制御できます。 ホストコンピュータはUSB仮想シリアルポートを介して電力測定ボードに接続し、MCUはSPIによって測定ユニットを初期化および構成し、内部電流の測定と電圧の監視を開始します。MCUはゲインパラメータを調整し、SPIによって電流と電圧のデータをMCUに送信し、MCUはデータをホストコンピュータに送信して、仮想シリアルポートを介して処理および表示します。測定対象の回路の電圧降下は、まずプログラマブルアンプLTC6915で増幅され、同時にMCUがデータが異常でないかの状態を監視します。 R0はサンプリング抵抗、LTC6915は選択可能なプログラマブルアンプで、ゲインは14種類に設定でき、電流が変化するとPGAゲインパラメータが調整されます。ADC7175は24ビットの高精度ADCで、これは小電流測定のアプリケーションにより有利です。MCUが低電力モードを通常モードに切り替えると、LTC6915はSPIによってゲイン値を減少させます。 電力測定ボードは、2線式ケーブルによる簡単な接続方法を提供します。たとえば、MIMXRT1180EVKとMIMXRT1020EVKは電力測定ボードに接続されています。 USB仮想COMはデータ転送に使用され、PMT(電源管理ツール)または他のPCGUIによって表示され、測定電力データには電流、電圧、電力が含まれます。 添付ファイルには、より詳細な説明があります。 全般 LPC55xx ペリフェラル
View full article
FS26でS32K341に電力を供給する/v11の入手方法 S32K344評価ボードの回路図とボードを見ていますが、v11がどこから来ているのか理解できず、MCUのV11ピンにのみ接続されており、それ以外は何も接続されていないように見えます 私はこれを誤解しており、ボードに2.5Vと1.1Vを供給する必要はなく、これらのピンにコンデンサが必要なだけだと誤解していますか? 私はこれを見落としていました、私は正しく理解していますか、私は1.5Vを供給する必要があるだけでなく、VDD_HV_AとB、およびVREFHのために5Vを供給する必要がありますか? さらに、FS26のVCoreなどの電圧レベルをv15に電力を供給する方法がわかりません。この情報は、セキュアアクセスファイルの完全なデータシートに含まれていますか? Re:FS26でS32K341に電力を供給する/v11の入手方法 こんにちはジェイソンZ、 はい、あなたはそれを非常によく理解しています:V11ピンとV25ピンを外部に供給する必要はなく、デカップリングコンデンサを接続するだけで済みます。 はい、1.5VとVDD_HV_AとB、およびVREFHに5Vを供給する必要があります。 この情報は、S32K3xx MCUファミリのデータシート(図20など)およびS32K3xx MCUファミリ - リファレンスマニュアル(図165など)に記載されています。しかし、供給管理の最良のリファレンスは、S32K3 MCUの汎用 - ハードウェア設計パッケージで、考えられるすべての供給実施形態がリストされています。これらのドキュメントはいずれも[セキュリティ]セクションにはありません。 よろしくお願いいたします。 パベル
View full article
Autosar RTD開発キットを使用すると、s32k314は割り込みに入ることができませんが、s32dsパッケージインターフェースを使用して正常に送受信できます。 こんにちは、 (1)CAN開発にNXPパッケージインターフェースを使用すると、すべて正常に動作します。 (2) Autosar開発キットを使用すると、クロックが割り込みに入ることができません。下図のロジックが理解できません。メッセージ0x55AはIDからCANFDではないと判断できるのはなぜでしょうか? (3)Can_43_FLEXCAN_Writeインターフェースへの最初の呼び出し後、メッセージは内部のFlexCAN_Ip_Sendインターフェースで送信されず、後続の割り込みに入ることができないため、mb状態がビジー状態のままになり、後続の送信プロセスを実行できなくなります。 以下にEBプロジェクトとS32dsプロジェクトを示します。原因がAutosarによってカプセル化されたRTDパッケージに問題があるかどうかの確認にご協力ください。よろしくお願いいたします。EB 29.0を使用しており、対応するRTDバージョンはSW32K3_S32M27x_RTD_R21-11_5.0.0_D2410.exeです。 回复: 使用Autosar RTD开发包,s32k314无法进入中断,但使用s32ds封装接口可以正常收发 CANのTRCVはTJA1050です。can_STBやENピンの設定は不要です。
View full article
S32K146:D-Flash代码烧录 你好:         想了解一下,如果我拿到了一块新的S32K146芯片,在我没有运行过任何程序的情况下,将包含D-Flash区域的.hex文件直接烧写到芯片中,D-Flash区域能写入代码么,还是只有P-Flash地址段能够烧写成功? Re: S32K146:D-Flash Code burning Hi@ShaoTianzhi D-Flash的数据掉电也不会丢失,如果丢失一定是被擦除,擦除可能的原因 1.执行了分区操作,每次执行分区都会擦除数据 2.调试器在下载程序的时候,没有设置区域保护,默认会全擦。
View full article
Linux内核的调试方法 以下是针对内核性能要求或相关问题的一些调试方法。它包括所有常见的方法,例如 oops/panic 问题、内存问题等等。详情请查看附件。 操作系统和系统分析 糟糕/恐慌 地址2线 objdump gdb Pstore Kdump 内存调试 SLAB KASAN Kmem泄漏 性能 Perf Ftrace eBPF/密件抄送 i.MX 8 系列 | i.MX 8QuadMax (8QM) | 8QuadPlus i.MX 8M | i.MX 8M Mini | i.MX 8M Nano
View full article
S32 Power 设计工作室 v1.1 - 更新 1 现已发布 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 尊敬的S32DS用户: S32 Design Studio for Power v1.1 Update 1 已发布。 离线更新包可以在这里下载: https://www.nxp.com/webapp/Download?colCode=S32DS_PA_v1.1_UP1&appType=license&location=null&Parent_nodeId=14320533561557…    对于在线安装,请选择预定义的 NXP 存储库“帮助”->“安装新软件...”对话框: ${p2.metadata.repo.name} - http://www.nxp.com/lgfiles/updates/Eclipse/S32DS_POWER_1_1/com.freescale.s32power.updatesite       变更列表: 新的编译器版本 1.1.3– 请参阅编译器发行说明(附件)中的详细信息 适用于 Windows 10 的 SPT 工具包含 MS Visual C++ 2010 Redistributable x86 更新的 SPT 工具: ENGR00381373 - 生成 SPT 后出现错误构建 当目标寄存器与 src1 不同时,修复 ADD、SUB、CMP ENGR00380758 Windows 上的 spt2 不支持 64 位操作数 更新的示例 MPC5775K 的新 SPT1 示例 o SingleElf_MPC5748G 启动文件使用 GDB 命令“set architecture powerpc:vle”更新 图形工具 ENGR00380255 [SPT] 应使用标准包含项创建默认图表 错误修复: ENGR00375995 MPC5746C Embsys 寄存器定义缺少 SPI 寄存器集 ENGR00379744 SPT 汇编程序应在 MPC577xK 或 S32R274 项目创建后初始化“包含路径(-I)”选项 ENGR00380796 链接器文件部分.spt应针对 SPT1/SPT2 进行校正 概述 回复:S32 Design Studio for Power v1.1 - 更新 1 可用 我们能否以 C 代码或 C 库文件的形式获得 SPT 功能 这将有助于我们在 IDE 中使用应用程序分析 ADC 输出。 #S32DS #SPT  @iulianbulancea  回复:S32 Design Studio for Power v1.1 - 更新 1 可用 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 看起来,线上和线下网站都宕机了很长时间。有什么提示吗?
View full article
Boundary Devices 的 SABRE Lite <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 飞思卡尔和 Boundary Devices 很高兴地宣布推出 i.MX6x Sabre Lite Board,这是一款配备强大的 i.MX 6Quad 应用处理器的低成本开发平台。     $299   i.MX6开发板 该平台的亮点包括: 1GHz 四核 ARM ® Cortex A9 处理器 1GB 64 位宽 DDR3 @ 532MHz 三个显示端口(RGB、LVDS 和 HDMI 1.4a) 两个摄像头端口(1x并行,1x MIPI CSI-2) 支持多流的高清视频引擎提供 H.264 1080p60 解码、1080p30 编码和高清 3-D 视频播放 三重播放图形系统由一个四着色器 3D 单元组成,能够达到 200MT/s,以及一个单独的 2-D 和单独的 OpenVG Vertex 加速引擎,可实现卓越的 3D、2D 和用户界面加速 串行 ATA 2.5 (SATA),3Gbps 双 SD 3.0/SDXC 卡插槽 PCIe端口(1通道) 模拟(耳机/麦克风)和数字(HDMI)音频 紧凑尺寸(3英寸x3英寸) 10/100/Gb IEEE1588以太网 10-pin JTAG interface 3 个高速 USB 端口(2xHost、1xOTG) 1个CAN2端口 I2C GPIOs     查看兼容产品: 7英寸显示屏 SATA 线缆 5MP 摄像头 Android 按钮板 适用于 Freescale 10.1 英寸的 LVDS 电缆 PCIE数据库   目前交货时间为 2-3 周 生产成本为 199 美元(2012 年 10 月)   点击此处获取更多信息。   概述
View full article
バウンダリーデバイス - FreeRTOS BSP v1.0.1 for Nitrogen7 & Nit6_SoloX <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> このブログ記事では、i.MX6SoloX および i.MX7D プロセッサのアーキテクチャを紹介し、MCU で FreeRTOS BSP v1.0.1 をビルドして実行する方法について説明します。 どちらのプロセッサも、 Cortex-A と Cortex-M4 コアを1つのチップ内で結合し、MPUとMCUの最高の機能を提供します(i.MX7Dの図を参照)。以下の内容は、 当社のNit6_SoloX および Nitrogen7 プラットフォームに適用されます。 せっかちな方へ デモ画像はこちらからダウンロードできます。 Nit6_SoloX のための 20160804-buildroot-nitrogen6sx-freertos-demo.img.gz 窒素の 20160804-buildroot-nitrogen7-freertos-demo.img.gz 7 通常どおり、NXPコンテンツが含まれているため、当社のサイトに登録し、EULAに同意する必要があります。イメージは 1GB の SD カード イメージで、Linux で zcat と dd を使用して復元できます。 ~$ zcat 20160804-buildroot*.img.gz |sudo dd of=/dev/sdX bs=1M Windowsユーザーの方は、 Alex PageのUSB Image Toolをご利用ください。 このイメージには、次のコンポーネントが含まれています。 Linux kernel 4.1.15 Uブート v2016.03 FreeRTOS 1.0.1 デモアプリケーション 開始する前に、プロンプトからU-Bootを更新してください。 => clearenv を実行 => upgradeu を実行 アップグレード後、ボードがリセットされ、Cortex-M4で最初のHelloWorldアプリケーションを起動できます。 => m4update を実行 => m4boot を実行 アーキテクチャ はじめに、投稿全体で使用される用語の定義を次に示します。 MCU:ARM Cortex-Mシリーズなどのマイコンユニットで、ここではCortex-M4を指します MPU:ARM Cortex-Aシリーズなどのマイクロプロセッサユニット、ここではCortex-A9 / A7を指します RTOS:FreeRTOSやMQXなどのリアルタイムオペレーティングシステム i.MX6SXプロセッサとi.MX7プロセッサは、同じチップにMCUとMPUを提供し、これは ヘテロジニアスマルチコアプロセッシングアーキテクチャと呼ばれます。 それはどのように機能しますか? 最初に知っておくべきことは、コアの1つが「マスター」であり、他のコアの起動を担当しているということです。これは、リセットされたままになるコアです。 BootROM は常に Cortex-A コア を最初に起動します。この記事では、 U-Boot がシステムで使用されるブートローダーであると仮定しています。その理由は、U-Boot が Cortex-M4 を起動できる bootaux コマンドを提供しているためです。 起動すると、両方のCPUは独立して、異なる命令を異なる速度で実行します。 コードはどこから実行されていますか? 実際には、使用するアプリケーション リンカスクリプト に依存します。GCC がアプリケーションを ELF 実行可能ファイルにリンクする場合、メモリ内のコード位置を知る必要があります。 どちらのプロセッサにもいくつかのオプションがあり、コードは次のいずれかに配置できます。 TCM (密結合メモリ):32kBが利用可能 OCRAM:32kB利用可能 EPDC を使用しない場合は、128kB を使用できますが、ocram リンカ スクリプトを変更する必要があります DDR:最大1MB利用可能 QSPIフラッシュ (ou Nit6_SoloXでは使用不可):128kBをNitrogen7に割り当て TCMはCortex-M4専用の内部メモリであるため、最高のパフォーマンスを提供するため、可能な場合は推奨されるオプションであることに注意してください。 DDRやQSPIなどの外部メモリは、より多くのスペースを提供しますが、アクセス速度も大幅に低下します。 この記事では、すべてのアプリケーションが TCM から実行されることを前提としています。 MCUはどんなときに役に立ちますか? MCUはすべてのリアルタイムタスクに最適ですが、MPUはGNU / Linuxなどの非リアルタイムOSで優れたUIエクスペリエンスを提供できます。 ここでは、Linuxカーネルはリアルタイムではなく、決定論的ではないが、Cortex-M4上のFreeRTOSはリアルタイムではないという事実を主張します。 また、ファームウェアは非常に小さく、読み込みが速いため、MCUは数百ミリ秒以内に完全に動作できますが、通常はLinux OSが動作するのにはるかに時間がかかります。 MCUが有用であることが証明されているアプリケーションの例: モーター制御:DCモーターは、フィードバック応答時間が重要であるため、リアルタイム環境でのみ良好に機能します オートモーティブ:CANメッセージをMCUで処理し、非常に早い段階で運用可能 リソース・ドメイン・コントローラ (RDC) 両方のコアが同じペリフェラルにアクセスできるため、同時アクセスを回避するメカニズムが作成され、一方のコアでのプログラムの動作がもう一方のコアで実行/アクセスされる内容に依存しないようにすることができます。 このメカニズムはRDCであり、各コアに ペリフェラルおよびメモリのアクセス許可を付与する ために使用できます。 FreeRTOS BSP の例とデモアプリケーションは、RDC を使用して周辺機器のアクセス許可を割り当てます。FreeRTOS BSP サンプル/デモを使用して ARM Cortex-A アプリケーションを実行する場合は、 予約済みの周辺機器を尊重することが重要です。 FreeRTOS BSP アプリケーションには、ARM Cortex-M4 でのみ使用される予約済み周辺機器があり、 これらの周辺機器で ARM Cortex-A コアからアクセスすると、プログラムがハングする可能性があります。 デフォルトの RDC 設定は次のとおりです。 ARM Cortex-M4 コアは RDC ドメイン 1 に割り当てられ、ARM Cortex-A コアおよびその他のバス マスターはデフォルトの割り当て (RDC ドメイン 0) を使用します。 すべての例/デモには、hardware_init.cに特定のRDC設定があります。それらのほとんどは排他的アクセスに設定されています。 このパッケージのユーザーは、サンプル/デモまたは自分のアプリケーションで RDC 設定を削除または変更できます。可能な限り、ペリフェラルのアクセスを、それを使用する唯一のコアに制限することをお勧めします。 また、周辺機器がLinuxで利用可能として表示されないようにするには、デバイスで周辺機器を無効にすることが必須であるため、MCUを使用するときに特定のデバイスツリーが使用されます。 imx7d-nitrogen7-m4.dts メモリ宣言は、FreeRTOS や共有メモリ用に一部の領域を予約するために、上記のデバイスツリーでも変更されます。 リモート・プロセッサー・メッセージング (RPMsg) Remote Processor Messaging (RPMsg) は、非対称マルチプロセッシング (AMP) システムに存在する同種または異種コア上で動作する独立したソフトウェアコンテキスト間でのプロセッサー間通信 (IPC) を可能にする virtio ベースのメッセージングバスです。 RPMsg API は、アップストリームの Linux 3.4.x カーネル以降に存在する RPMsg バスインフラストラクチャに準拠しています。 この API には、次の利点があります。 割り込みコンテキストでのデータ処理なし ブロッキング受信 APIの ゼロコピー 送受信API RTOSが提供する タイムアウト 付き受信 DDR は、コア間でメッセージを交換するために RPMsg でデフォルトで使用されることに注意してください。 実装の詳細が記載されたリンクを次に示します。 RPMsg_RTOS_Layer_User's_Guide.pdf https://www.kernel.org/doc/Documentation/rpmsg.txt その他のドキュメントはどこで入手できますか? BSPには、このテーマについて詳しく知るために読むことをお勧めするいくつかのドキュメントが実際に付属しています。 FreeRTOS_BSP_1.0.1_i.MX_7Dual_Release_Notes.pdf FreeRTOS_BSP_for_i.MX_7Dual_Demo_User's_Guide.pdf FreeRTOS_BSP_i.MX_7Dual_API_Reference_Manual.pdf Getting_Started_with_FreeRTOS_BSP_for_i.MX_7Dual.pdf ビルド手順 開発環境のセットアップ FreeRTOS BSP をビルドするには、まず ARM Cortex-M プロセッサ用のツールチェーンをダウンロードしてインストールする必要があります。 ~$ cd && mkdir ツールチェーン && cd ツールチェーン ~/toolchains$ wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 ~/toolchains$ tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 ~/toolchains$ rm gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 FreeRTOS はビルドを cmake に依存しているため、次のパッケージがマシンにインストールされていることも確認する必要があります。 ~$ sudo apt-get install make cmake BSPのダウンロード FreeRTOS BSP v1.0.1 は、GitHub の freertos-boundary リポジトリから入手できます。 ~$ git clone https://github.com/boundarydevices/freertos-boundary.git freertos ~$ cd フリートス 使用する予定のプロセッサ/ボードによって、ブランチは異なります。 Nit6_SoloX (i.MX6SX) の場合は、imx6sx_1.0.1 ブランチを使用します。 ~/freertos$ git checkout origin/imx6sx_1.0.1 -b imx6sx_1.0.1 Nitrogen7 (i.MX7D) の場合は、imx7d_1.0.1 ブランチを使用します。 ~/freertos$ git checkout origin/imx7d_1.0.1 -b imx7d_1.0.1 最後に、 ARMGCC_DIR 変数をエクスポートして、FreeRTOS がツールチェーンの場所を認識できるようにする必要があります。 ~/freertos$ export ARMGCC_DIR=$HOME/toolchains/gcc-arm-none-eabi-4_9-2015q3/ FreeRTOS アプリの構築 まず、FreeRTOS BSP の概要を簡単に説明します。 すべてのアプリケーションは、examples フォルダの下にあります。 examples/imx6sx_nit6sx_m4/ Nit6_SoloX用 examples/imx7d_nitrogen7_m4/ 窒素用7 例として、 Nitrogen7 の helloworld アプリケーションを構築します。 ~/freertos$ cd examples/imx7d_nitrogen7_m4/demo_apps/hello_world/armgcc/ ~/freertos/examples/imx7d_nitrogen7_m4/demo_apps/hello_world/armgcc$ ./build_all.sh ~/freertos/examples/imx7d_nitrogen7_m4/demo_apps/hello_world/armgcc$ ls release/ hello_world.bin hello_world.elf hello_world.hex hello_world.map build_all.sh スクリプトは、デバッグ バイナリとリリース バイナリの両方をビルドします。デバッグに使用する JTAG がない場合は、デバッグ ターゲットを破棄できます。 その後、そのhello_world.binファームウェアをSDカードのルートにコピーしてフラッシュできます。 デモ アプリを実行する 基本セットアップ まず、 この投稿の冒頭 で提供されている画像をSDカードにフラッシュする必要があります。 SDカードには、Cortex-M4の使用を可能にするU-Bootバージョンが含まれていますので、 せっかちなセクション で説明されているように 必ず更新 してください。 デフォルトでは、ファームウェアは NOR から TCM にロードされます。NORでファームウェアをアップグレードするための m4update を実行できます。外部ストレージ(SD、USB、SATA)のルートとしてm4_fw.binという名前のファイルを探し、NORのオフセット 0x1E0000 でフラッシュします。 => m4update を実行 別の名前のファイルをフラッシュする場合は、次のように m4image 変数を変更できます。 => setenv m4image MCUでのデバッグ中に、すべてのファームウェアをNORに書き込まないようにしたい場合があるため、外部ストレージから直接M4ファームウェアをロードするコマンドを追加しました。 => setenv m4boot 'run m4boot_ext' 先に進む前に、「コンソール」とマークされたポートがU-Bootに使用され、もう1つがMCUからのデータを表示するため、2番目のシリアルポートをマシンに接続してください。 起動時にMCUを自動的に起動するには、ファームウェアをロードするように 6x_bootscript に指示する変数を設定する必要があります。これを行うには、この変数 を必ず保存 してください。 => setenv m4enabled 1 => saveenv このブログ記事では、TCMを実行用のファームウェアの場所としてのみ考慮しています。OCRAM、QSPI、DDR など、別のメモリを使用する場合は、U-Boot 変数で指定できます。 => setenv m4loadaddr => setenv m4size リンカスクリプトは、プログラムを別の場所から実行するには異なる必要があることに注意してください。また、現在NORで予約されているサイズは 128kBです。 Hello Worldアプリ Hello World プロジェクトは、BSP ソフトウェアを使用する 簡単な デモ プログラムです。BSP UARTドライバを使用して、ARM Cortex-M4端末に「Hello World」メッセージを出力します。このデモの目的は、UART の使用方法を示し、デバッグとさらなる開発のための簡単なプロジェクトを提供することです。 U-Boot で、次のように入力します。 => setenv m4image hello_world.bin => m4update を実行 => m4boot を実行 2 番目のシリアル ポートには、次の出力が表示されます。 ハローワールド! その後、その端末に何かを入力でき、 ソースコードでわかるように、シリアルポートにエコーバックされます。 RPMsg TTY demo このデモ アプリケーションは、 RPMsg リモート ピア スタックを示します。Linux RPMsg マスターピアと連携して、文字列コンテンツを相互に転送します。Linux ドライバーは、書き込み可能な tty ノードを作成します。MCUは受信した内容を表示し、確認応答と同じメッセージをエコーバックします。ARM Cortex-A コアの tty リーダーは、メッセージを受け取り、別のトランザクションを開始できます。このデモは、任意のコンテンツを送受信する RPMsg の機能を示しています。 U-Boot で、次のように入力します。 => setenv m4image rpmsg_str_echo_freertos_example.bin => m4update を実行 => ブート 2 番目のシリアル ポートには、次の出力が表示されます。 RPMSG 文字列エコー FreeRTOS RTOS API デモ... RPMSG リモートとして初期化 Linuxが起動したら、2つのコア間の通信を開始できるように、RPMsgモジュールをロードする必要があります。 # modプローブ imx_rpmsg_tty imx_rpmsg_tty rpmsg0: 新チャンネル: 0x400 -> 0x0! rpmsg tty ドライバをインストールしてください!# エコーテスト > /dev/ttyRPMSG 上記の最後のコマンドはttyノードに書き込みを行うため、Cortex-M4は2番目のシリアルポートで確認できるデータを受信しているはずです。 ネームサービスのハンドシェイクが完了し、M4 は rpmsg チャネル [0 ---> 1024] を設定しました。 マスター側からメッセージを受け取る : "test" [len : 4] マスター側から新行を取得する RPMsg ピンポンのデモ 前のデモと同様に、このデモは RPMsg 通信を示しています。通信チャネルが作成されると、Linux OS は最初の整数を FreeRTOS OS に転送します。受信側ピアは、整数に 1 を加算して転送し直します。ループは無限に続きます。 U-Boot で、次のように入力します。 => setenv m4image rpmsg_pingpong_freertos_example.bin => m4update を実行 => ブート 2 番目のシリアル ポートには、次の出力が表示されます。 RPMSG PingPong FreeRTOS RTOS APIデモ... RPMSG リモートとして初期化 Linuxが起動したら、2つのコア間の通信を開始できるように、RPMsgモジュールをロードする必要があります。 #modprobeのimx_rpmsg_pingpong imx_rpmsg_pingpong rpmsg0: 新チャンネル: 0x400 -> 0x0! # 1 を取得 (src: 0x0) 3を取得(SRC:0x0) 5を取得(SRC:0x0) ... MCUから受信したデータをメインシリアルポートで送信できますが、MPUから受信したデータをセカンダリシリアルポートで確認することもできます。 ネームサービスのハンドシェイクが完了し、M4 は rpmsg チャネル [0 ---> 1024] を設定しました。 マスター側からデータを取得する : 0 マスター側からデータを取得する : 2 マスター側からデータを取得する : 4 ... これで、ビルド、変更、実行、デバッグができるようになります 全般 Re: Boundary Devices - FreeRTOS BSP v1.0.1 for Nitrogen7 & Nit6_SoloX <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> t
View full article
S32G IPCF Mコア 専門家の皆さん、こんにちは。 IPCF関数をデバッグしていました。S32DSの例(名前を変更しました)を使用しましたが、プラットフォームはS32G399Aです。しかし、Mコアイメージを正常にロードできませんでした。何か提案をいただけますか?ありがとうございます! 回复: S32G IPCF M core こんにちは @Celeste_Liu MコアのIPCF 4.9はどうすれば入手できますか?S32DSで使用するには 回复: S32G IPCF M core 親愛なる@piaochunri、 はい、AコアとMコアのIPCFバージョンは同じであるべきだと説明しようとしていました。次の図は、両方に IPCF 4.9.0 を使用した場合の結果です。お悩みが解決してよかったです。 よろしくお願いいたします。 Celeste 回复: S32G IPCF M core はい、MコアのIPCF4.10を使用した後、問題は解決しました。 ご協力の程、よろしくお願い申し上げます。 回复: S32G IPCF M core Hello, 発生したカーネルパニックの状況については、次の方法を試して、それが役立つかどうかを確認できますか? 当初は、バイナリを最初にDDRAMにロードし、次にSRAMにロードする次の手順がありました。 fatload mmc 0:1 0x80000000 IPCF_Example_S32G274A_M7_0.bin cp.b 0x80000000 0x34300000 0x300000 ただし、上記の 2 つのコマンドを実行する代わりに、次のコマンドを実行して SRAM に直接ロードしました。 fatload mmc 0:3 0x34300000 IPCF_Example_S32G274A_M7_0.bin 効果がないかご確認ください。   よろしくお願いいたします。 Celeste 回复: S32G IPCF M core yoctoで生成されたrootfsとカーネルソースを使用しました。イメージと dtb を手動でビルドしました (phy config を修正) が、rootfs で生成された ipcf ko ファイルは変更しませんでした。そして、koファイルをインストールしたとき。それでもパニックに陥りました。 root@s32g399ardb3:/lib/modules/5.15.145-RT73+G3A3FAFB13BAA+P1/extra# INSMOD IPC-SHM-DEV.KO root@s32g399ardb3:/lib/modules/5.15.145-RT73+G3A3FAFB13BAA+P1/extra# INSMOD IPC-SHM-SAMPLE.KO [ 7.494024] pfeng 46000000.pfe:HIF2 開始 [ 7.589045] pfeng 46000000.pfe pfe2: PHY [PFEng イーサネット MDIO.2:03] ドライバー [mv88Q2112] (irq=POLL) [ 7.589070] pfeng 46000000.pfe PFE2:PHY / RGMII-IDリンクモードの構成 [ 7.591039] pfeng 46000000.pfe:HIF1 開始 [ 7.691887] pfeng 46000000.pfe pfe1: PHY [PFEng イーサネット MDIO.1:03] ドライバー [mv88Q2112] (irq=POLL) [ 7.691913] pfeng 46000000.pfe PFE1:PHY/RGMII-IDリンクモードの設定 [ 7.694032] pfeng 46000000.pfe:HIF0 開始 [ 7.694050] pfeng 46000000.pfe PFE0:固定/SGMIIリンクモードの設定 [ 7.694413] pfeng 46000000.pfe pfe0: リンクがアップ - 1Gbps/フル - フロー制御オフ [ 7.694616] IPv6: ADDRCONF(NETDEV_CHANGE): pfe0: リンクが準備可能になります [ 7.740501] pfeng 46000000.pfe pfe1: TX クロックを 125000000Hz に設定します [ 7.740539] pfeng 46000000.pfe pfe1: リンクがアップ - 1Gbps/フル - フロー制御オフ [ 7.740564] IPv6: ADDRCONF(NETDEV_CHANGE): pfe1: リンクが準備完了になります [ 41.180243] CPU1 の SError 割り込み、コード 0x00000000bf000002 -- SError [ 41.180262] CPU:1 PID:381 Comm:insmod Tainted:G O 5.15.145-rt73+g3a3fafb13baa+p1 #1 [ 41.180270] ハードウェア名:NXP S32G399A-RDB3 (DT) [ 41.180275] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 41.180281] PC : ipc_shm_init+0x424/0x8b0 [ipc_shm_dev] [ 41.180300] LR番号:ipc_shm_init+0x11c/0x8b0 [ipc_shm_dev] [ 41.180310] sp:ffffffc0096eb9d0 [ 41.180313] x29: ffffffc0096eba60 x28: ffffffc000990078 x27: 000000000000000000 [ 41.180326] x26: 0000000000000000000 x25: ffffffc000988340 x24: ffffffc00b100008 [ 41.180334] x23: ffffffc000988348 x22: 0000000000000000000000 x21: ffffffc00b100008 [ 41.180343] x20: ffffffc0009900b8 x19: 000000000000008d0 x18: ffffffffff [ 41.180352] x17: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [ 41.180360] x14: 0000000000000001 x13: 007473696c5f7974 x12: 696e696666615f65 [ 41.180368] x11: 0000000000000040 x10: ffffffc008d91290 x9 : 0000000000000000000000 [ 41.180377 ] x8 : ffffff88011f9900 x7 : 0000000000000009 x6 : 000000000000024e [ 41.180386] x5 : 0000000000000008 x4 : ffffff880123f5c8 x3 : 0000000000000000000 [ 41.180395] x2 : 0000000000000003 x1 : 0000000000000001 x0 : ffffffc000988340 [ 41.180406] カーネルパニック - 同期しない: [ 41.180408] 非同期SError割り込み [ 42.180556] SMP:セカンダリCPUの停止 [ 42.388550] カーネル オフセット: 無効 [ 42.392015] CPU機能:0x8,00002001,20000842 [ 42.396530] メモリ制限:なし [ 42.399572] ---[ カーネルパニックの終了 - 同期しない: 非同期 SError 割り込み ]--- 回复: S32G IPCF M core Hello piaochunri, カーネルパニックの発生は、手動コンパイルに関連している可能性があります。私たちはあなたの問題をうまく再現することはできません。事前構築済みのイメージを使用して、上記の問題が引き続き発生するかどうかを確認できますか?または、モジュールを1つずつ交換することで、障害が発生しているモジュールを特定できます。 よろしくお願いいたします。 Celeste 回复: S32G IPCF M core どうもありがとうございます! 私はあなたの提案を試しました。しかし、カーネルのロードを続行することはできません。ログは以下の通りです。他に何か問題がありますか? ログ: Uブート 2022.04-dirty(2024年9月12日 - 14:17:18 +0800) SoC:NXPのS32G399Aリビジョン1.1 CPU:ARM Cortex-A53 r0p4 @最大1300 MHz モデル:NXP S32G399A-RDB3 DRAM: 3.5 GiB コア:306デバイス、25 uclass、デバイスツリー:ボード MMC:FSL_SDHC:0 MMC から環境を読み込んでいます...わかりました s32cc_serdes_phy serdes@44180000: SerDes サブシステムのモード 1 を使用 s32cc_serdes_phy serdes@44180000: XPCS0 がリセットされています s32cc_serdes_phy serdes@44180000: XPCS init が失敗しました pci_s32cc pcie@44100000: PHY 'serdes_lane0' を取得できませんでした で: serial@401c8000 アウト:serial@401c8000 エラー:serial@401c8000 取締役会の改訂:リビジョン不明:(0x717) ネット: eth0: ethernet@4033c000 PFEバージョン0x0101(S32G3)が見つかりました pfeng pfeng-base: CLASS ファームウェアのアップロード pfeng pfeng-base: EMAC0 ブロックが初期化されました pfeng pfeng-base: EMAC1 ブロックが初期化されました pfeng pfeng-base: EMAC2 ブロックが初期化されました pfeng pfeng-base: CLASS ブロックの有効化 pfeng pfeng-base: PFE プラットフォームが正常に開始されました (マスク: 7) s32cc_serdes_phy serdes@44180000: SerDes サブシステムのモード 1 を使用 s32cc_serdes_phy serdes@44180000: XPCS0 がリセットされています s32cc_serdes_phy serdes@44180000: XPCS init が失敗しました pfeng_netif pfe0: 'emac0_xpcs' PHY を取得できませんでした 、eth1:pfe0、eth2:pfe1、eth3:pfe2 自動起動を停止するには、任意のキーを押します:0 => dcache off;mw.q0x34100000 0x0 0x40000;脂肪負荷MMC 0:1 0x80000000 IPCF_FreeRTOS_S32G399A_M7_0.bin;cp.bの0x800 00000 0x34300000 0x300000;startm7 0x34500400; 2359376バイトを191ミリ秒(11.8MiB/秒)で読み取った SRAMアドレス0x34500400でコアを開始CM7_0...完成です。 => ブート パーティション#0に切り替えて、OK mmc0 は現在のデバイスです 14555144バイトを704ミリ秒(19.7MiB/秒)で読み取った mmc から起動しています ... 60860 バイトを 94 ミリ秒で読み取り (631.8KiB/s) ## Error: "fdt_fixups" not defined ## フラット化されたデバイス ツリー BLOB (83000000) fdt blob を使用して 0x83000000 で起動する デバイスツリーを0000000083000000の位置で使用し、0000000083011dbbで終了します XPCS0_0の無効化 カーネルを起動中… そして、それはここで止まりました。 回复: S32G IPCF M core 親愛なる@piaochunri、 まず、2つ目の質問にお答えしたいと思います。写真から、SDカードに入れたIPCF_M7_0_blob.binという名前のファイルが見えます。このバイナリファイルがIVTツールを使用して生成されたブロブ画像であるかどうか知りたいですか?それとも、このように名付けられているだけですか? 実際、IPCF EXAMPLEについては、ここに詳細な説明があり、次の図に示すように詳細な手順があります。ブロブ画像は必要ないことに注意してください。代わりに、直接コンパイルされた bin ファイルを使用できます。 ビルド済みのLinux bsp40イメージを使用し、上記の手順に従うことで、操作に問題はありません。 上記の情報がお役に立てば幸いです。カーネルパニックの問題については、さらに調査した後、返信します。 よろしくお願いいたします。 Celeste 回复: S32G IPCF M core そして、バージョンサプリメントを作ります。 IPCF Mコア:4.9 Linux bsp:40.0 IPCF Aコア:4.10 次の 2 つの問題があります。 1.ipc-shm-dev.koをインストールできますが、ipc-shm-sample.koをインストールするとカーネルがパニックになりました。 2.次のコマンドを使用しました:"dcache off;mw.q0x34000000 0x0 0x100000;脂肪負荷MMC 0:1 0x80000000 IPCF_FreeRTOS_S32G399A_M7_0_blob.bin;cp.qの0x80000000 0x34300000 0x60000;startm7 0x34500400;そして「boot」と入力した後、カーネルパニックが発生して続行できなくなりました。. 手伝ってくれませんか?
View full article
Understanding IEEE1588V1-V2 Simple understanding of IEEE 1588 protocol IEEE 1588 is a precision time protocol (PTP) for synchronizing clocks in computer networks. In local area networks, it can control clock accuracy in the sub-microsecond range, making it suitable for measurement and control systems. The IEEE 1588 standard defines a master-slave architecture for clock distribution, consisting of one or more network segments and one or more clocks. The time synchronization protocol in the TSN network uses the IEEE 802.1AS protocol, which is simplified and modified based on the IEEE 1588 protocol and is also called the gPTP protocol. ​ IEEE 1588 protocol is short for Precision Timing Protocol (PTP), and its full name is "Precision Clock Synchronization Protocol Standard for Network Measurement and Control Systems" (IEEE 1588 Precision Clock Synchronization Protocol). The basic principle of its operation is to send synchronized data frames between master and slave nodes, record the sending time and receiving time information of the data frames, and add the time information to the data frames. The slave node obtains this time information, calculates the time deviation between the slave node's local clock and the master clock and the transmission delay between network nodes, and corrects the local clock to synchronize it with the master node clock. There can only be one master clock in a PTP network. The PTP protocol is mainly divided into two parts to achieve clock synchronization function: 1. Establish a synchronization system: The protocol uses the Best Master Clock Algorithm (BMCA) to select a master clock, establish a master-slave topology, and then establish a synchronization system in the entire PTP network. 2. Synchronize local clock: The protocol uses the Local Clock Synchronization Algorithm (LCS) to calculate the time deviation between the local clock of each slave node and the master clock through the exchange of PTP data packets between the master and slave nodes in the network, and adjust the local clock to synchronize it with the master clock. IEEE 1588v1 ​ The clocks in the entire PTP network can be divided into ordinary clocks (OC) and boundary clocks (BC) according to the number of PTP communication ports on them: there is only one ordinary clock, while there are multiple boundary clocks. Boundary clocks are generally used at network nodes with low determinism, such as switches or routers, as shown in the figure below. PTP communication is carried out independently on each port. 1. Boundary Clock: Only one slave port is allowed on the boundary clock, which communicates with the master port of the upper node and synchronizes its local clock with the master port. The remaining ports are master ports, which communicate with the slave ports of the downstream nodes. The boundary clock can connect to different network protocols. 2. Synchronous system establishment process: ​ (1) In the initial state, each node port will listen to the Sync data frame in the network within the specified time; if a Sync data frame is received, the node port will determine the port state according to the best master clock algorithm. If no Sync data frame is received, the node state changes to Pre_Master and assumes itself as the master clock node. At this time, the node port state is the master clock, but no Sync frame is sent. ​ (2) The port status remains Pre_Master for a certain period of time: If a Sync data frame is received within the specified time of the port, the port status is determined by the best master clock algorithm. If the port is determined to be a master clock, it will periodically send Sync frames; if it is determined to be a slave clock, it will accept Sync frames, calculate the deviation, and correct the local clock. If the port does not receive a Sync data frame within this time period, the state is changed to the master clock and the Sync data frame is started to be sent regularly. ​ (3) The status of the master clock and slave clock changes with the change of clock performance and operating status. The figure below shows the state transition in BMCA. 3. Time synchronization establishment process: ​ As shown in the figure below, the PTP synchronization principle As shown in the figure, the Master is the synchronization clock source in the network, which can be considered to be infinitely close to UTC or GPS time. The Slave is the device that needs to be synchronized in the network. Assuming that the path from the Master to the Slave conforms to the symmetric path, the delay on the path is set as Delay, and the time difference between the Master and Slave devices to be synchronized is Offset, that is, the Slave is slower than the Master at the same time by Offset.         The Slave device can calibrate the local clock according to the calculated Offset. However, the 1588V1 protocol relies on the symmetry of the link, that is, the delay from Master to Slave and from Slave to Master is consistent, which is difficult to meet in actual network conditions, so an additional asymmetric algorithm is needed to calculate and compensate for the link delay difference. IEEE 1588v2 ​IEEE1588V2 has made improvements and extensions on IEEE1588V1. Mainly includes: 1. Added independent message mode for point-to-point path delay measurement. The path delay time Delay between port A and port B is: In PTPv1, the average path delay is measured by using Sync frames and Delay_Req frames, but in PTPv2, the Sync frame is not required, and the measurement is performed only through the PDelay_Req data frame series. This is an independent delay measurement process that does not rely on the participation of Sync frames and the establishment of a synchronization system, which improves the measurement accuracy and can obtain a more accurate path delay by averaging the average value after multiple measurements. On the other hand, if the synchronization system in the network changes, there is no need to recalculate the path delay between the nodes. The previously measured delay data can be used directly, which greatly enhances the efficiency of the protocol execution and makes the protocol more convenient and flexible. In PTPv2, the use of the PDelay_req data frame series has become the main method for measuring path delay. 2. Added transparent clock model In PTPv1, all the intermediate nodes in the network adopt the boundary clock model. The boundary clock connected to the only master clock in the network, that is, an ordinary clock, receives the synchronization data frame sent by the master node through its only slave port, and synchronizes with the master clock. The remaining master ports and other boundary clocks connected to them send synchronization data frames, and finally synchronize to the ordinary clock at the edge of the network, thus achieving time synchronization of the entire network. Although this method is feasible, since this method is synchronized step by step, the farther the node is from the master clock, the lower the synchronization accuracy. When some nodes in the network do not need clock synchronization or do not have synchronization function, the transparent clock model can be used. Unlike the BC/OC mode, the transparent clock does not require each node to synchronize with the master clock. Its port only forwards the protocol data frame and adds the calculated data frame retention time to the correction domain. This method makes the processing of PTP data frames simpler, reduces the difficulty of implementing the PTP protocol in the network, and improves the synchronization accuracy of each slave node. There are two models of transparent clock: end-to-end transparent clock and point-to-point transparent clock. (1) End-to-end (E2E) transparent clock The E2E transparent clock does not process ordinary data frames in the network, but only transmits them to allow them to pass normally. However, for PTP event data frames, the residence delay time from the receiving port to the sending port is accumulated to the correction field in the data frame to compensate for the delay error caused by the PTP data frame passing through itself. (2) Point-to-point (P2P) transparent clock Point-to-point (P2P) transparent clock only forwards specific PTP messages, including Sync frames, Follo_Up frames, and Announce frames. It also uses the Pdelay_Req data frame series to calculate the path delay time between each port and the port it is connected to, and then combines it with the delay time between ports and adds it to the time correction domain to compensate for the time delay of the data frame from the source port to the point-to-point transparent clock out port. 3. Adding a single-step clock model The single-step clock model solves the problem of matching Follow_Up frames with Sync frames. The basic synchronization process of the PTP protocol adopts a two-step mode, that is, the master clock node sends a Sync frame and a Follow_Up frame with the Sync frame sending time. Although this method can improve the accuracy of the Sync frame timestamp and improve the synchronization effect, when the network load is large, the data frame is likely to be lost or blocked, resulting in errors in the matching of the two data frames. Set a flag in the PTP data frame to use the single-step mode, and use the difference between the sending time of the Sync frame and the time tag in the data frame as the transmission delay, and add it to the correction field. In this way, the master clock can perform time synchronization calibration through a separate Sync frame without the need for Follow_Up. Single-step mode can reduce network traffic and improve the reliability of synchronization when the network load is large. Single-step mode requires additional auxiliary hardware to help calculate the time correction value and accumulate it into the correction domain, which has relatively high requirements on the real-time performance of the network. BMCA BMCA, or Best Master Clock Algorithm, selects the best performing clock in the network as the master clock, and uses it to establish the network topology, generate a synchronization system, and thus realize the clock synchronization function. The best master clock is selected by transmitting Announce frames in each node in the network, comparing the clock attributes on each node (such as whether the clock is designated as a master or slave clock), the clock level used to identify the accuracy, and the clock type used to identify the clock source type (such as rubidium clock, cesium clock, etc.), as well as clock characteristics such as clock offset and variance, clock address, and clock port number to select the best master clock. When other clock characteristics are the same, the protocol will use the node clock with the smallest port number as the master clock. The IEEE 1588 protocol will form a tree topology with the master clock node as the root node, and to avoid generating loops, the protocol defines those node ports that fail in competition as passive or disabled.
View full article
S32DS 3.4 の FreeMASTER CAN サンプルS32K144 Hi, MCUXpressoを持っていませんが、S32DS 3.4を使用しています。ビルド201217(Update3) S32DSを使ってFreeMasterをCANでS32K144実装してみました。 SDK の例は、UART との通信です。 S32K3xx uCにCANの例があるのを見て、S32K144に移植しようとしましたが、エラーが多すぎました。 144でCANと通信する方法を説明するのに十分な例がないようです。 私の製品は数キロ離れた場所から動作する可能性があるため、UART通信を使用できません。 S32DS上でS32K1xxを使用したCAN通信のサンプルコードを教えてください。 ありがとうございます。 Re:S32DS 3.4のFreeMASTER CAN例S32K144 Hi @CY9, FreeMASTERドライバには、複数の定義に対するガードがあります。これには、通信インターフェースの定義が含まれます( freemaster_private.h:298参照) /* only one communication link may be selected */ #if (!(FMSTR_DISABLE)) && FMSTR_COUNT_INTERFACES > 1 #error More than one communication interface selected for FreeMASTER driver. #endif コンパイラは、互換性のない定義がある場合にエラーが発生します。 また、FMSTR_USE_FLEXCANが定義されている場合は、プロジェクトにFMSTR_InitSerialシンボルが生成されないようにする必要があります。 これを確認するには、.map ファイルの内容または .elf ファイル シンボルを調べます。 この出力は、CANの場合に生成されます。 C:\NXP\S32DS.3.5\S32DS\build_tools\gcc_v6.3\gcc-6.3-arm32-eabi\arm-none-eabi\bin>readelf.exe C:\fmstr_rtd_fcan_s32k144\Debug_FLASH\fmstr_rtd_fcan_s32k144.elf -s | find "FMSTR_InitCan" 610: 00000e39 56 FUNC GLOBAL DEFAULT 3 FMSTR_InitCan C:\NXP\S32DS.3.5\S32DS\build_tools\gcc_v6.3\gcc-6.3-arm32-eabi\arm-none-eabi\bin>readelf.exe C:\fmstr_rtd_fcan_s32k144\Debug_FLASH\fmstr_rtd_fcan_s32k144.elf -s | find "FMSTR_InitSerial" 2 番目のコマンドは、空の結果を返します。 クリーンタスクが古いelfファイルを削除しないか、デバッグ構成が完全な再構築をトリガーしない可能性があると思われます。これにより、デバッグ セッションは古いバージョンの elf ファイルを再利用します。 Re:S32DS 3.4のFreeMASTER CAN例S32K144 Dear iulian_stan, プロジェクトには定義が多すぎるようですが、定義が混同されることがありますか? 参照: 私はプロジェクトでUSRTを設定および定義していませんが、定義に含まれているFMSTR_InitSerial()‵を呼び出そうとします。 #if FMSTR_USE_SERIAL /* initialize communication and start listening for commands */ if (!FMSTR_InitSerial()) return FMSTR_FALSE; #endif そして、 'FMSTR_USE_SERIAL'は今= 0です。 #define FMSTR_DISABLE 0 /* ... */ #define FMSTR_USE_LPUART 0 /* !!!!! */ #define FMSTR_USE_FLEXCAN 1 #define FMSTR_USE_PDBDM 0 //... #if (FMSTR_USE_SCI) || (FMSTR_USE_ESCI) || (FMSTR_USE_LPUART) || (FMSTR_USE_JTAG) || (FMSTR_USE_USB_CDC) || (FMSTR_USE_MQX_IO) || (FMSTR_USE_MBED) #ifndef FMSTR_USE_SERIAL #define FMSTR_USE_SERIAL 1 #else #if FMSTR_USE_SERIAL == 0 #error "FMSTR_USE_SERIAL macro cannot be configured by user, FreeMASTER serial driver functionality is not garanted." #endif #endif #else #ifndef FMSTR_USE_SERIAL #define FMSTR_USE_SERIAL 0 #endif #endif Re:S32DS 3.4のFreeMASTER CAN例S32K144 Hi @CY9, 1.これは、FreeMASTERドライバーの新しいバージョンで修正されたバグです。その割り当ては、前の{}ブロックの内側にある必要があります。 if (discard > 0U) { ... /* buffer is for sure not full */ pbuff->flags.flg.bIsFull = 0; pbuff->nRP = rp; } S32K1ファミリのライブラリを更新する予定ですが、現時点ではETAはありません。 2.まず、プロジェクトをクリーンアップし(安全のために、Debug_FLASHフォルダを手動で削除します)、再構築します。問題が解決しない場合は、新しい DS への移行中に、一部のファイルが重複したことを意味します。問題のある関数 (例: SystemInit) を検索すると、プロジェクト ファイル内の定義が重複し、冗長なソース パスが削除されます。 Re:S32DS 3.4のFreeMASTER CAN例S32K144 Dear iulian_stan , CANバスでテストします、それは動作します! よろしくお願いします。 2つの質問があります。 1.   FMSTR_PipeDiscardBytes() { if(discard > 0) { rp = ...; } pbuff->nRP = rp; } So, if (discard<=0) , rp = ?? 2.  S32DS 3.5をダウンロードして、最新のものにアップデートしました。 プロジェクトをクリーンアップして再構築しようとすると、エラーメッセージ: 建物対象:fmstr_rtd_fcan_s32k144.elf 起動時:標準S32DS Cリンカ arm-none-eabi-gcc -o "fmstr_rtd_fcan_s32k144.elf""@fmstr_rtd_fcan_s32k144.args" c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exeに追加します。./SDK/platform/devices/S32K144/startup/system_S32K144.o: 関数 'SystemInit' 内: D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/platform/devices/S32K144/startup/system_S32K144.c:69: 'SystemInit' の複数の定義; ./SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.o:D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.c:69:ここで最初に定義 c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exeに追加します。./SDK/platform/devices/S32K144/startup/system_S32K144.o: 関数 'SystemCoreClockUpdate' 内: D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/platform/devices/S32K144/startup/system_S32K144.c:128: 'SystemCoreClockUpdate' の複数の定義; ./SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.o:D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.c:128:ここで最初に定義 c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exeに追加します。./SDK/platform/devices/S32K144/startup/system_S32K144.o: 関数 'SystemSoftwareReset' 内: D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/platform/devices/S32K144/startup/system_S32K144.c:179: 'SystemSoftwareReset' の複数の定義; ./SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.o:D:\Project\TYC\S32DS35\fmstr_rtd_fcan_s32k144\Debug_FLASH/../SDK/S32K144_SDK_4.0.1/platform/devices/S32K144/startup/system_S32K144.c:179:ここで最初に定義 ......  ビルドに失敗しました。エラーが 57、警告が 5 件。(6秒272msかかった) 何か提案はありますか、ありがとう。 Re:S32DS 3.4のFreeMASTER CAN例S32K144 Hi @CY9,  S32 Design Studioプロジェクトに添付されています。 注: このプロジェクトは S32DS 3.5 および S32SDK 4.0.1 でビルドされました。
View full article
在 u-boot 中添加 SD/eMMC 设备和主机之间的调试消息。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 有时您会遇到 SD/eMMC 问题:“卡对电压选择没有响应!”。您可以添加调试消息来查看 SD/eMMC 与主机之间的通信。 #定义调试 #定义 CONFIG_MMC_TRACE & 在 mmc.c (driver/mmc) 中添加调试消息 int mmc_send_cmd(结构mmc *mmc,结构mmc_cmd *cmd,结构mmc_data *数据) { .. printf("CMD_SEND:%d\n",cmd->cmdidx); printf("\t\tARG\t\t\t0x%08X\n", cmd->cmdarg); .. } => mmcinfo CMD_SEND:0 阿根廷 0x00000000 MMC_RSP_NONE CMD_SEND:8 ARG                     0x000001AA           MMC_RSP_R1,5,6,7        0x00000001 命令发送:55 阿根廷 0x00000000 MMC_RSP_R1,5,6,7 0x00000001 CMD_SEND:0 阿根廷 0x00000000 MMC_RSP_NONE
View full article