Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
Zephyr 的内存详情 如果您对这些资源有任何疑问或问题,请 提出新问题,恩智浦支持团队将为您解答。 在学习 Zephyr 时,存在许多与内存相关的问题。链接器会将代码和数据放置在何处?应用程序应如何配置以使用其他存储器? 链接器所使用的默认内存段是在设备树中进行配置的。通常,设备树会使用选定的节点来配置这些部分。以下是 MIMXRT1060-EVK 板上的一个示例: chosen { zephyr,flash = &is25wp064; zephyr,sram = &sdram0; }; 这些选定节点的名称可能会造成误导。 zephyr,flash 指向链接器用于所有代码(.text)和只读数据段的节点。通常,这指向物理闪存,例如,在这块板上,它被放置在外部 QSPI 闪存中,但它也可以位于非闪存的内存中。 zephyr,sram 指向链接器用于所有 .data和 .bss部分的节点。这应该位于 RAM 中,但不一定在 SRAM 中。在该板上,它位于外部 SDRAM 中。应用程序可以将这些节点指向最适合该应用程序的其他内存。其他常用的内存节点包括 &dtcm 、 &itcm 或 &ocram 。 通常,这些选定的节点在电路板设备树文件中进行设置。但是在学习 Zephyr 以及使用设备树时,最好在应用程序构建过程中生成的设备树文件中确认设备树设置,请参阅实验室指南:设备树和 VS Code 设备树查看器。 i.MX RT内存 大多数内存问题来自使用 i.MX RT 设备的用户。这些微控制器(MCU)是高性能无闪存设备,具备多种内部和外部存储选项,以最大化应用程序的性能和灵活性。以下是一些专门针对 i.MX RT 设备的有用资源: i.MX RT 应用说明: AN12437 i.MX RT系列性能优化 AN12077 使用 i.MX RT FlexRAM AN13970 Zephyr 中的 RT 系列内存重定位 ROM 中的引导加载程序在启动时需要 Flash 配置块(FCB),并且可以选择添加设备配置数据 (DCD) 或外部存储器配置数据 (XMCD),这些数据通常用于启用 SDRAM。这篇文章提供了更多关于在哪里可以找到这些结构,以及如何将它们包含在开发板中的详细信息。 不支持 SDRAM 的情况说明:Zephyr 对配备外部 SDRAM 的实时开发板的支持,通常会将数据存储在 SDRAM 中。ROM 引导加载程序会在 Zephyr 应用程序执行之前,通过 DCD 或 XMCD 配置 SDRAM 接口。这篇文章讨论了如何移除定制主板的 SDRAM。 如需配置 FlexRAM,调整 ITCM、DTCM 或 OCRAM 的大小,请参阅 AN13970 Zephyr 中的 RT 系列内存重定位 将代码重新定位到 RAM 中 将代码移至 RAM 是一个常见需求,例如,为了最大化性能或降低功耗。借助 Zephyr,应用程序可以将所有代码或部分代码迁移到 RAM 中。以下是一些有用的搬迁资源: AN13970 Zephyr 中的 RT 系列内存重定位 Zephyr代码和数据重定位API 重新定位代码的示例应用: 简单示例SDRAM_hello_world.zip将整个应用程序移动到 SDRAM,并在启动时使用 ROM 引导程序加载 RAM,然后再执行应用程序。 Zperf 示例:此 Zephyr 网络示例将网络堆栈和以太网驱动程序代码迁移至 ITCM,以提高在 MIMXRT1170-EVK 上构建时的性能。其余代码保留在默认的外部 QSPI 闪存中。 NXP SmartWatch 演示和网络研讨会:将大部分代码重新定位到内部 SRAM 以降低功耗,同时将图形资产保留在闪存中。 将数据加载到 RAM 在 Zephyr 中,所有数据、变量和堆栈的默认位置都位于 zephyr,sram 节点。然而,某些应用程序希望将特定数据放置在其他位置。例如,将数据放置在 DTCM 中以最大化性能,将 DMA 缓冲区放置在不可缓存的内存中,或将显示的大型帧缓冲区移动到外部 RAM。以下是一些有助于指定数据放置的资源: 静态变量的声明可以包含链接器段标签,以便将它们放置在特定段中。一个参考示例是dma_mcux_edma.c驱动程序,它将 dma_tcdpool 结构放置在 __dtcm_noinit_section 或 __nocache 部分。 静态变量的另一种选择是在变量声明中使用设备树节点,从而将其放置在特定的部分中。一个可以参考的例子是恩智浦的面部检测演示。此演示在设备树中添加选定的节点 zephyr,modelbuf ,该节点指向内存部分节点 sramx 。要使用此方法,内存段节点需要具备属性 zephyr,memory-region 。在源代码中, model_input_buf 缓冲区是用 zephyr_modelbuf 节点声明的。然后,链接程序将 model_input_buf 放置在 sramx 部分。 整个源文件或库中的 data 和 bss 部分可以重定位到其他 RAM,详情请参阅 Zephyr代码和数据重定位 API。 Zephyr 可以使用一个特殊的固定区域,将中断堆栈和主堆栈放置在不同的 RAM 区段中。简单示例pinned_hello_world.zip在 DTCM 中固定中断和主堆栈。   其他内存资源 示例调整内存节点大小,利用 NXP LPC5500 中的所有 SRAM 返回Zephyr知识中心
View full article
VDD(INTF)のみが存在し、VDDPに電源が供給されていない場合のTDA8035の動作 以下の場合に TDA8035 がどのように動作するかを知りたいです。 VDD(INTF)=3.3V VDDP= 0V(電源なし) TDA8035 はリセットモードになっているようですが、よく分かりません... 確認していただけますか? この状態は長期間(数時間以上)許容されますか? この場合の VDD(INTF) の消費量はどのくらいでしょうか? よろしくお願いいたします。 よろしくお願いいたします。 シルヴァン 接触型スマートカードリーダーIC Re: TDA8035 behaviour when only VDD(INTF)is present, not powered VDDP こんにちは@sylvainbouriot VDD(INTF) = 3.3V、VDDP = 0Vで電源投入時: TDA8035 はリセット状態のままとなり、スマート カードの起動を試行しません。 この状態は、チップを損傷したり異常な動作を引き起こしたりすることなく、長期間にわたって継続できます。 VDDP = 0 でチップがリセット/パワーダウンモードの場合: VDD(INTF) の標準的な電流は非常に小さく、通常は数 µA から数十 µA の範囲です。消費電流は主にデジタル保持に使用されます。 Re: TDA8035 behaviour when only VDD(INTF)is present, not powered VDDP カイリーさん、非常に正確な答えをありがとう。 TDA8035 がアクティブ モードの場合、VDD(INTF) = 3.3 V のときの VDD(INTF) の消費量はどのくらいですか? よろしくお願いいたします。 シルヴァン Re: TDA8035 behaviour when only VDD(INTF)is present, not powered VDDP VDDP = 3.3V または 5V の場合...
View full article
S32K3 FLEXIO data exception I am using S32K314 RTD400 SAI0 (host) and FLEXIO analog I2S (slave) communication, SAI only use d0, MUX_DISABLE, word width of 16, found that the data received by the slave is the host's data cycle to move one bit left to get the data, such as sending 0x8002, in the code inside the slave get the data is 0x5, change a lot of configuration is useless, finally check the Enable User Mode Support in the figure below, the data is normal. For example, if you send 0x8002, the data received by the slave in the code is 0x5. After changing a lot of configurations, the data is normal after checking Enable User Mode Support in the following figure. The SAI configuration is as follows Re: S32K3 FLEXIO数据异常 Hi@Jason22 I checked the compilation results, this option you check or uncheck does not affect the results of the run at all. According to the project you provided, the compilation I got with Enable User Mode Support checked and unchecked is exactly the same, which means it doesn't cause the problem you described. Re: S32K3 FLEXIO数据异常 Compile no problem, there is no "Mcal.h" file, if so, clear the project, compile again and there will be no problem (I do not know if this is the IDE version of the problem, S32DS 3.6 does not seem to have this error). If it's not this error, can you tell me what's wrong with the compilation? Re: S32K3 FLEXIO数据异常 Hi@Jason22 Sorry, I read it wrong, it's not the IDE version, it's that I read Enable User Mode Support as Enable Flexio Common Support Can you double check the project you provided, I can't get it to compile successfully. Re: S32K3 FLEXIO数据异常 没有勾选“Enable User Mode Support”,配置还是有效 不勾选"Enable Flexio Common Support",配置才无效,我使用的是S32DS 3.5.14,这和S32DS版本有关嘛 Re: S32K3 FLEXIO数据异常 Hi@Jason22 你不勾选“Enable User Mode Support”下面的配置不是不生效了嘛 Re: S32K3 FLEXIO数据异常 Hi@Jason22 Logic analyzer yourself to test if the data you're sending out is correct or not Re: S32K3 FLEXIO数据异常 I also compared it and found the same thing, re-ran the program and found that after checking the box, the data looped left again, but the first time I checked the box, the data did go normal, and repeated the run a few times and it was normal, so I don't know what factors are causing this. Then I would like to ask, is it my configuration or the code has a problem, why the data received by the slave is just the result of the data sent by the host cyclic left shift? Thanks for your help. Data sent by the host Data received from the slave
View full article
Hello NPU! Running a TFLite model on i.MX 9 The following is a guide on training a simple model in Pytorch and Tensorflow and deploying it on an application using the i.MX93 Ethos-65 Neural Processing Unit (NPU). After following this guide you will accomplish: Training a simple CNN on the MNIST dataset Convert the model to tflite, quantize it and compile it for the i.MX93 NPU (Ethos-65). Run a simple application where a digit can be drawn and identified by our model. Prerequisites To follow this guide you will need: Yocto image, GTKMM3 support is needed for the C++ example, for the python example a pre-built image can be used. An i.MX93 board Running Python example The application implementation is provided in both Python and C++, if using the python application, pre-built full image can be used instead, simply copy the python scripts to the target and execute as follows: # Running quantized example on the CPU ./run.py -m cnn_tf_quant.tflite # Running example on the Ethos NPU ./run.py -m cnn_tf_quant_vela.tflite -d /usr/lib/liblitert_ethosu_delegate.so Pre-built models are provided in the attachment however steps and scripts used to train and generate the models are also included (see below). Building image with GTKMM3 support (C++ example only) The GUI application used for demonstration has been written in GTKMM3 (C++ wrapper of the GTK library) therefore an image with GTKMM3 support is needed, luckily there is already a recipe we can use to easily integrate this into our yocto image. To build the image simply follow the instructions in the Yocto User's guide, as of the time of this writing the latest BSP is 6.12.49_2.2.0 so we will use that. Once you have setup all the requirements in your host and installed repo, you can setup your build enviroment as follows: repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-walnascar -m imx-6.12.49-2.2.0.xml repo sync Depending on your target you can now setup your build directory, we will use wayland graphics with X11 support, and the iMX93 Freedom board as example: DISTRO=fsl-imx-xwayland MACHINE=imx93-11x11-lpddr4x-frdm source imx-setup-release.sh -b 93-frdm-xwayland Simply select the MACHINE configuration that matches your board. Now we're almost ready to start the build, we still need to add GTKMM3 support to our image, simply modify your local.conf file under conf/local.conf and add the following: IMAGE_INSTALL:append = " gtkmm3" Make sure the space in front of gtkmm3 is there to avoid issues on the build. Since the build is very resource intensive out of memory issues can arise during the build, to limit the amount of concurrent recipes attempted to build at once it is recommended to add the following as well: BB_NUMBER_THREADS="8" PARALLEL_MAKE="-j8" BB_PRESSURE_MAX_CPU ?= "50000" BB_PRESSURE_MAX_IO ?= "100000" BB_PRESSURE_MAX_MEMORY ?= "25000" After this your local.conf should look similar to this:  NOTE: Make sure to have plenty of storage available on your machine since the build requires upwards of 500GB to complete. The build can now start, if you want to build the GTKMM application from source it is required to have an available SDK create it as follows: bitbake imx-image-full -c populate_sdk And to create the image simply do: bitbake imx-image-full We require the full image since it contains all the Tensorflow Lite libraries and different examples. After the build completes the toolchain can be installed and the image flashed onto the board. To install the toolchain: ./tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93-11x11-lpddr4x-frdm-toolchain-6.12-walnascar.sh And afterwards every time you want to use the toolchain: source /opt/fsl-imx-xwayland/6.12-walnascar-full-gtkmm3/environment-setup-armv8a-poky-linux To flash the image to an SD card: zstdcat imx-image-full-imx93-11x11-lpddr4x-frdm.rootfs.wic.zst | sudo dd of=/dev/mmcblk0 bs=1M conv=fsync And now you are ready to build the application, train some models and deploy them. Building the GTKMM3 application (C++) The source for the application can be found here, a prebuilt binary is also provided and attached here.  The application contains a drawing area where one can simply draw a digit with the mouse or touch display, and two buttons one to clear the drawing area and one to trigger the execution of the model and predict the digit. To build from scratch CMake is required, as well as a toolchain with support for GTKMM3 (see above), the following steps can be followed to build the project: sudo apt install cmake git clone https://github.com/ManRod2982/drawing_window_imx cd drawing_window_imx/drawing_window_cpp/ source /opt/fsl-imx-xwayland/6.12-walnascar-full-gtkmm3/environment-setup-armv8a-poky-linux cmake -B build -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake cmake --build build After this a binary called window will be created under the build directory, now it can be simply copied to the target SD card. If using linux the filesystem will be mounted, so you can simply copy the binary to the root directory: sudo cp build/window /media/user/root/root/ SCP can also be used if a connection to the board is already established: scp build/window [email protected]:/root And after this on the target the application can be started as follows: ./window -m model_path [optional] -d delegate_path [optional] -v Three parameters are accepted by the application: Path to the model: -m or --model_path [Optional] Path to the delegate if any: -d or --delegate_path, if none is provided the model will be attempted to be run on the CPU using the XNN delegate [Optional] Verbosity flag, if present the model will output more information Now we need a model to run. Training a simple CNN model Looking at the Machine Learning User's guide for this release. The following is the support for the different frameworks with respect to the available compute engines in each device: Tensorflow Lite and LiteRT (latest release of Tensorflow Lite and the only one moving forward) are the frameworks that are widely supported for most compute engines in the i.MX9 family, this guide will use Tensorflow lite since the example uses C++ and the current release of LiteRT only supports Python, however the interface and process it's pretty much the same. Setting up the environment The example repository contains different python scripts used to train the models and convert them to the tflite format. In order to follow the next steps a python3 installation is necessary. It is recommended to setup a virtual environment: python3 -m venv myenv source myenv/bin/activate pip install -r requirements.txt This will install all the required packages for both Tensorflow and Pytorch. Training a model with Tensorflow Tensorflow allows an straightforward path to quantize and convert the model to Tensorflow Lite, our Convolutional Neural Network (CNN) architecture looks as follows: model = tf.keras.models.Sequential([ tf.keras.layers.Input(batch_shape=(1, 28, 28, 1)), tf.keras.layers.Conv2D(16, 5, padding='same', activation='relu'), tf.keras.layers.Conv2D(32, 3, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.MaxPool2D(2, strides=(2,2)), tf.keras.layers.Flatten(), tf.keras.layers.Dense(100, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax') ]) We can train the model by running the script train_tf.py, it takes around 2min to train on a normal laptop and achieves 99.05% accuracy on the test dataset. For details on the framework please refer to the official Tensorflow documentation. After running the script we can visualize our model using the eIQ toolkit model visualizer or the Netron.app: The i.MX93 features an ARM Ethos-65 NPU which requires the weights, biases and inputs to be integers and our current model uses float32, therefore we need to quantize the model, to achieve this we can run tf2quant_tflite.py which will quantize the model and convert it to tflite: Which we can now see takes integer inputs and outputs, the weights and biases have also been quantized and we can easily see the difference in size of the files: The quantized model is 555kB whereas the float32 model is 2.2MB, since float32 requires 4 bytes to store each weight and bias, whereas the quantized model requires only one byte. You now have a model than can be used on the target, however as it is right now it will be run on the CPU using the XNN delegate, to run the model simply do: ./window -m cnn_tf_quant.tflite We can now compile our quantized model for the ARM Ethos NPU. The eIQ toolkit will be used. Open the model through the model tool: Navigate to the folder with your quantized model, cnn_tf_quant.tflite in this case and open it, you should be able to visualize the model, now we can click on the options menu to select convert: We select the i.MX93 converter, we will prompted to select the destination folder as well: After selecting the destination folder if all goes well the conversion finalizes and we should be able to visualize the model optimized to be run on the Ethos, any operations not supported by the NPU will be shown and carried out by the CPU, in the case of this simple example all the operations are carried out by the NPU: And we can now run the model on the target as follows: ./window -m cnn_tf_quant_vela.tflite -d /usr/lib/libethosu_delegate.so Training a model with Pytorch The repository contains a sample model using Convolutional Neural Networks to train on the MNIST data set, the model structure is as follows: NeuralNetwork( (cnn): Sequential( (0): Conv2d(1, 16, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2)) (1): ReLU() (2): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1)) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (6): Flatten(start_dim=1, end_dim=-1) (7): Linear(in_features=5408, out_features=100, bias=True) (8): ReLU() (9): Dropout(p=0.2, inplace=False) (10): Linear(in_features=100, out_features=10, bias=True) ) ) Pytorch models can be easily converted to Tensorflow lite (without quantization) to be run on the CPU, as well as the Open Neural Network Exchange  model (ONNX) however Executorch has recently been released, which is an inference model for pytorch models on embedded devices, support for it is currently in the works. The Pytorch model is defined under pytorch_model.py: #!/usr/bin/env python3 import torch from torch import nn # Define model class NeuralNetwork(nn.Module): def __init__(self): super().__init__() self.cnn = nn.Sequential( # Input 28x28x1, after padding 32x32x1, output 28x28x16 nn.Conv2d(in_channels=1, out_channels=16, kernel_size=5, padding=2), nn.ReLU(), # Input 28x28x16, output 26x26x32 nn.Conv2d(in_channels=16, out_channels=32, kernel_size=3), nn.ReLU(), nn.Dropout(p=0.2), # Input 26x26x32, output 13x13x32 nn.MaxPool2d(kernel_size=2, stride=2), nn.Flatten(), nn.Linear(13*13*32, 100), nn.ReLU(), nn.Dropout(p=0.2), nn.Linear(100, 10) ) def forward(self, x): logits = self.cnn(x) return logits  And the training is carried out by executing train_pytorch.py, the training achieves 99.3% accuracy on the test dataset and it takes around 7 min to complete on a normal laptop. For details on the framework itself and the training process refer to the official pytorch documentation. The pytorch model is then saved under pytorch_model.pth however pytorch does not save the graph information only the weights and biases, if we visualize the saved model on netron or the eIQ toolkit model visualizer we can observe the disconnected weight and biases: To better visualize our model we can simply convert it to the ONNX format by using the script pytorch2onnx.py, and now we can visualize the graph of our model on Neutron: NOTE: ONNX might also provide a way to quantize and convert the quantized model to tflite however in my tests of onnx-tf the tool seemed to be out of sync with the latest Tensorflow framewok, it was easier to create a similar model on Tensorflow and then quantize and export. We can now export our model to tflite, since the model is not quantized it will be run on the CPU (XNN delegate), to export it we run pytorch2tflite.py and we can now visualize the exported model: And we can run this model on the target as follows: ./window -m pytorch_cnn.tflite Deploying and running the model We now have an application where we can draw the digits, a model capable of detecting those digits, but our application needs to be able to execute that model and get the results, this is our next step. In order to be able to run the model on the target we need to: Load the model Create a tflite interpreter Load external delegates if any Allocate the tensors C++ example A minimal example is provided here, however it doesn't include the loading of the external delegate, which we will need in order to be able to run our model on the NPU. The required headers are the following: #include "tensorflow/lite/delegates/external/external_delegate.h" #include "tensorflow/lite/interpreter.h" #include "tensorflow/lite/interpreter_builder.h" #include "tensorflow/lite/kernels/register.h" #include "tensorflow/lite/model_builder.h" We can now load our model as follows using the TFLite API: std::unique_ptr<:flatbuffermodel> model = tflite::FlatBufferModel::BuildFromFile(model_path); An interpreter needs to be created now, for this an operation resolver is needed as well as our model: tflite::ops::builtin::BuiltinOpResolver resolver; std::unique_ptr<:interpreter> interpreter; tflite::InterpreterBuilder(*model, resolver)(&interpreter);  If a delegate is required we now need to create it and update our execution graph so that the interpreter knows to call the delegate on the supported operations: // Create external delegate option and pass the delegate library TfLiteExternalDelegateOptions external_delegate_options = TfLiteExternalDelegateOptionsDefault(delegate_path); // Create the External Delegate. This will load the delegate. TfLiteDelegate *external_delegate = TfLiteExternalDelegateCreate(&external_delegate_options); // Add External Delegate into TFLite Interpreter to automatically delegate nodes. if (interpreter->ModifyGraphWithDelegate(external_delegate) != kTfLiteOk) { std::cerr << "Failed to add delegate" << std::endl; } We can now allocate the tensors for our model: // Allocate tensors for the model if (interpreter->AllocateTensors() != kTfLiteOk) { std::cerr << "Failed to allocate tensors" << std::endl; } And at this point we are ready to run the inference using our model! The last step is to fill the input buffers with our data, invoke the interpreter and retrieve the results from the output buffer, in the following example with a float model: // Fill input buffers // Note: The buffer of the input tensor with index `i` of type T can // be accessed with `T* input = interpreter->typed_input_tensor (i);` float *input_tensor = interpreter->typed_input_tensor (0); std::memcpy(input_tensor, input.data(), input.size() * sizeof(float)); // Run inference if (interpreter->Invoke() != kTfLiteOk) { std::cerr << "Failed to invoke Interpreter!" << std::endl; return {}; } // Read output buffers // Note: The buffer of the output tensor with index `i` of type T can // be accessed with `T* output = interpreter->typed_output_tensor (i);` float *output_tensor = interpreter->typed_output_tensor (0); std::memcpy(output, output_tensor, output.size() * sizeof(float)); In our example application the interpreter creating and inference calling is wrapped in a class called NnModel, it's implementation can be seen on the repository but it can handle both the float models and int8 models without any modification. The class is instantiated inside the main routine and the inference is called every time the predict button is clicked. // Create model with parsed parameters NnModel nn(model_path, delegate_path, verbose); void Window::on_predict_clicked() { // Save screen to file std::cout << "Predict clicked!" << std::endl; // Call inference on NnModel depending on the type // the model expects int number; auto data_type = nn_.get_dtype(); switch (data_type) { case kTfLiteFloat32: { std::vector drawing = mouse_drawing.export_to_vector (28, 28, 255.0); std::vector output_vec_f = nn_.infer (drawing); number = get_max_index (output_vec_f); break; } case kTfLiteInt8: { std::vector drawing = mouse_drawing.export_to_vector (28, 28, 255.0); std::vector output_vec_int = nn_.infer (drawing); number = get_max_index (output_vec_int); break; } default: std::cerr << "Cannot handle input type: " << std::to_string(data_type) << std::endl; break; } std::string display = "You drew a: " + std::to_string(number); std::cout << display << std::endl; text_view.set_text(display); } Python example The process for creating an interpreter in Python is pretty similar, we still need to load a delegate if any is used and load the model as well as allocate the tensors. In this example LiteRT is used instead however the API remains the same, the only change needed is where the interpreted is imported from. The following minimal code can be used to load the model and any external delegates: from ai_edge_litert.interpreter import Interpreter # Create interpreter if delegate_path is not None: # attempt to load external delegate if provided (platform specific) try: from ai_edge_litert.interpreter import load_delegate delegate = load_delegate(delegate_path) self.interpreter = Interpreter(model_path=model_path, experimental_delegates=[delegate]) except Exception as e: raise RuntimeError(f"Failed to load delegate: {e}") else: self.interpreter = Interpreter(model_path=model_path) self.interpreter.allocate_tensors() We now have an interpreter we can use, we just need to fill the input tensors, invoke the interpreter and retrieve the output tensors with the results from our model: # Set input input_details = self.interpreter.get_input_details()[0] self.interpreter.set_tensor(input_details['index'], input_data) # Run inference self.interpreter.invoke() # Get results out_details = self.interpreter.get_output_details()[0] output_data = self.interpreter.get_tensor(out_details['index']) These steps are contained in a wrapper class under nn_model.py.  Benchmarking the models A prebuilt benchmarking tool is provided in the release it generates random inputs and measures the time it takes to run the inference on the model, the following are the results running the different models on the i.MX93: ./benchmaark_model --graph=model --num_threads=num_cores   CPU 1 core CPU 2 cores NPU pytorch_cnn.tflite 1559.61 us 1023.22 us NA cnn_tf_quant.tflite 585.37 us 379.69 us NA cnn_tf_quant_vela.tflite NA NA 221.84 us This is of course a toy example but it can be observed how running on the dedicated hardware provides a significant improvement on inference speed. The following is a guide on training a simple model in Pytorch and Tensorflow and deploying it on an application using the i.MX93 Ethos-65 Neural Processing Unit (NPU) and the i.MX95 eIQ Neutron NPU.
View full article
CSEc Error I'm using CSEc with S32K144, when does it return KEY_INVAILD error at BOOT_DEFINE? I hope to get answers and have a happy day! Re: CSEc Error Hi @xiaozhi  I can't see a reason for such error when calling BOOT_DEFINE function. This function can be called even if BOOT_MAC_KEY is not provisioned yet, so it does not require a key.  Regards, Lukas
View full article
CSEC GenerateMACAddrMode 地址范围 圣诞快乐 你好 当我使用 CSEC 的 GenerateMACAddrMode 函数时,当地址值超过 0x7DFFF 时,会发生错误。这正常吗? Re: CSEC GenerateMACAddrMode address range 我的错 我的意思是无法从 512kb CSEC_DRV_GenerateMACAddrMode(CSEC_RAM_KEY,(uint8_t *)0x0007FFFC, 0x00000080, (uint8_t *)cmacout) 中取出; 但我使用 addr = 0x0007FFFC,len = 0x00000080 也没有错误,但超出范围 Re: CSEC GenerateMACAddrMode address range 你好@SaLan 这是 Addr 模式下 CMD_GENERATE_MAC 命令(也称为指针方法)的限制: 分区(即块大小)可以是 128KB、256KB 或 512KB,视衍生产品而定: 此致, Lukas
View full article
imx95 low power mode I am working on a custom i.MX95 board running Linux 6.12 (Yocto-based). I am facing a suspend-to-RAM (deep sleep) failure related to the USB3 host controller. When executing echo mem > /sys/power/state, the system aborts suspend with xhci-hcd: WARN: xHC CMD_RUN timeout followed by PM: failed to suspend async: error -110. The issue occurs consistently when USB host mode is enabled, even with no active USB traffic. I am using a fixed 5V VBUS regulator controlled by a GPIO, and the USB3 controller, PHY, clocks, and power-domains are defined in the DTS (attached). My requirement is to fully power off USB VBUS during low power mode while allowing the system to enter deep sleep successfully. I have attached the full suspend/resume dmesg logs and the relevant USB-related DTS nodes for reference. I would like guidance on the correct DTS and/or driver-side handling required to avoid the xHCI suspend timeout on i.MX95. Re: imx95 low power mode In custom board iam using fusb302 but not enabled as usb3.0 , we are using it as usb2.0 . but when entering into deep sleep ( echo mem > /sys/power/state ) The error is occuring in xhci-hcd driver. Test Setup: • SoC: i.MX95 • OS: Yocto Linux (kernel 6.x, NXP BSP) • USB Mode: Host (xHCI, USB3) • Connected Device: USB flash drive (Mass Storage) Boot the board normally. Connect a USB storage device to the USB3 host port. Verify enumeration using lsusb and confirm device is accessible. Enter low power mode using: echo mem > /sys/power/state After this step itself it is showing error. Resume the system using the configured wake-up source (power button/ GPIO). After resume, observe that the USB device either: is not detected, or shows xHCI / DWC3 related errors in dmesg, or requires USB re-plug to work again. ERROR LOGS : echo mem > /sys/power/state [ 117.057281] PM: suspend entry (deep) [ 117.066009] Filesystems sync: 0.005 seconds [ 117.071209] Freezing user space processes [ 117.076800] Freezing user space processes completed (elapsed 0.001 seconds) [ 117.083781] OOM killer disabled. [ 117.087011] Freezing remaining freezable tasks [ 117.132725] Freezing remaining freezable tasks completed (elapsed 0.041 seconds) [ 117.140164] printk: Suspending console(s) (use no_console_suspend to debug) [ 117.156868] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 117.267552] xhci-hcd xhci-hcd.2.auto: WARN: xHC CMD_RUN timeout [ 117.267611] xhci-hcd xhci-hcd.2.auto: PM: dpm_run_callback(): platform_pm_suspend returns -110 [ 117.267631] xhci-hcd xhci-hcd.2.auto: PM: failed to suspend async: error -110 [ 117.267702] PM: Some devices failed to suspend, or early wake event detected [ 117.268017] hub 1-0:1.0: hub_ext_port_status failed (err = -108) [ 117.268044] usb usb1-port1: cannot disable (err = -108) [ 117.516365] PM: resume devices took 0.248 seconds [ 117.570639] OOM killer enabled. [ 117.573777] Restarting tasks ... done. [ 117.575261] sd 0:0:0:0: [sda] Test Unit Ready failed: Result: hostbyte=0x01 driverbyte=DRIVER_OK [ 117.578423] random: crng reseeded on system resumption [ 117.587117] sda: detected capacity change from 120164352 to 0 [ 117.598136] PM: suspend exit -sh: echo: write error: Connection timed out Re: imx95 low power mode Could you share us the details steps, that we can reporcuce it on our EVK Board? Thanks Re: imx95 low power mode Hi @kannappan , OK, we are going to have the New Year's Day holiday. when I back to office I will try it on our board and then give your reply. Wish you have a nice day Best Regards Rita Re: imx95 low power mode Hi @kannappan , Sorry for too busy this week, I will test it for you next week and share the result to you. Wish you have a nice day Best Regards Rita Re: imx95 low power mode HI @Rita_Wang , Is there any reply for the above issue. Best Regards Kannappan
View full article
S32K344 是否支持用于铁路应用的 EN 50128 / SIL 3/4? 您好, 我正在评估铁路功能安全项目的 S32K344(双核)。我需要知道这种 MCU 是否可用于需要..: EN 50128(铁路软件功能安全标准) SIL 3/SIL 4 功能安全等级 另外: 恩智浦是否有支持 SIL 3/4 设计的指南或文档? 对于在关键任务和非关键任务中安全使用双核有什么建议? 提前感谢! Re: S32K344 will support EN 50128 / SIL 3/4 for railway applications? 请注意,在圣诞假期期间,我们的支持响应时间可能会比平时长。在某些情况下,您的请求可能会在新年后得到处理。感谢您的理解。 Re: S32K344 will support EN 50128 / SIL 3/4 for railway applications? 你好@Yuvashree S32K344 根据 ISO 26262 开发,支持 ASIL D,在功能安全完整性方面,ASIL D 与 SIL 3 大致相当。不过,恩智浦并未提供符合 EN 50128 或 SIL 4 标准的认证或声明。如果您的项目需要 EN 50128,则需要使用可用的功能安全文档(功能安全手册、FMEDA 等)自行进行功能安全评估和流程调整。 此致, Lukas
View full article
s32k3xx_dio_s32ct 情報キャッシュフォルダまたはアーティファクトが見つかりません エラー S32K3_Examples s32k3xx_dio_s32ct を実行していますが、このサンプル モデルのコード生成中にエラーが発生します。 添付のビルド概要と以下のログ詳細を確認して、サポートしてください。   ### s32k3xx_dio_s32ct のビルド手順を開始します ### 「モデル固有の」フォルダ構造にコードと成果物を生成する ### ビルドフォルダにコードを生成しています: C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw ### s32k3xx_dio_s32ct.rtw でターゲット言語コンパイラを呼び出す ### システムターゲットファイルの使用: C:\MATLAB\R2024b\rtw\c\ert\ert.tlc ### TLC 関数ライブラリを読み込んでいます ........ ### カスタム データ用の TLC インターフェース API を生成しています。 ### ユーザー定義のコードをキャッシュするためのモデルを最初にパススルーします。 ### キャッシュモデルのソースコード ................................................ ### ヘッダーファイル s32k3xx_dio_s32ct_types.h の書き込み ### ヘッダーファイル s32k3xx_dio_s32ct.h を書き込んでいます。 ### ヘッダーファイル rtwtypes.h の書き込み ### ソースファイル s32k3xx_dio_s32ct.c を書き込んでいます ### ヘッダーファイル s32k3xx_dio_s32ct_private.h の書き込み ### ソースファイル s32k3xx_dio_s32ct_data.c を書き込んでいます ### ヘッダーファイル rtmodel.h を書き込んでいます。 ### ソースファイルert_main.cを書き込んでいます ### TLC コード生成が完了しました (12.619 秒かかりました)。 ### バイナリ情報キャッシュを保存しています。 # ## Using toolchain: S32DS GCC ## # 'C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw\s32k3xx_dio_s32ct.mk' を作成しています... ### 's32k3xx_dio_s32ct' をビルディングしています: "C:\MATLAB\R2024b\bin\win64\gmake" -f s32k3xx_dio_s32ct.mk -j all C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw>PATH=C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\tools\build_tools\gcc_v10.2\gcc-10.2-arm32-eabi\bin;C:\MATLAB\R2024b\bin\win64;C:\Users\hp\AppData\Local\Programs\Python\Python310\Scripts\;C:\Programファイル (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramFiles\PuTTY\;C:\Users\hp\AppData\Local\Programs\Python\Python310\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Geehy\openocd-20240916\OpenOCD-20240916-0.12.0\bin;C:\Programファイル (x86)\Geehy\xpack-windows-build-tools-4.3.0-1-win32-x64\xpack-windows-build-tools-4.3.0-1\bin;C:\Programファイル (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\ProgramFiles\Git\cmd;C:\Program Files\dotnet\;C:\MATLAB\R2024b\bin;C:\Program Files\7-Zip;C:\Users\hp\.mcuxpressotools\dtc-1.6.1\tools\usr\bin;C:\Users\hp\.mcuxpressotools\gperf-3.0.1\bin;C:\Users\hp\.mcuxpressotools\wget-1.21.4;C:\Users\hp\.mcuxpressotools\ninja-1.12.1;C:\Users\hp\.mcuxpressotools\cmake-3.30.0-windows-x86_64\bin;C:\ProgramFiles\Python\Python310\Scripts\;C:\Program Files (x86)\Vim\vim90;C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\bin C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw>cd 。C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw>if "all" == "" ("C:\MATLAB\R2024b\bin\win64\gmake" -f s32k3xx_dio_s32ct.mk -j all ) else ("C:\MATLAB\R2024b\bin\win64\gmake" -f s32k3xx_dio_s32ct.mk -j all ) "C:\MATLAB\R2024b\bin\win64\gmake": 割り込み/例外が発生しました (コード = 0xc00000fd、アドレス = 0x41a0c5) C:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw>echo makeコマンドがエラー255を返しました makeコマンドがエラー255を返しましたC:\MATLABAddOns\Toolboxes\NXP_MBDToolbox_S32K3\S32K3_Examples\dio\s32k3xx_dio_s32ct\s32k3xx_dio_s32ct_ert_rtw>exit /B 1   ### s32k3xx_dio_s32ct のビルド手順はエラーのため中止されました。   ビルドの概要   上位モデル ターゲット: モデル ビルド理由 ステータス ビルド期間 =============================================================================================================================================================== s32k3xx_dio_s32ct 情報キャッシュフォルダまたはアーティファクトが見つかりません。ビルドに失敗しました。           「 s32k3xx_dio_s32ct 」のビルディング中にエラーが発生しました             Re: s32k3xx_dio_s32ct Information cache folder or artifacts were missing Error こんにちは、 @mohit2904さん、 ログテキスト全体をコピーして貼り付けていただけますか?そうすれば、問題を特定しやすくなります。また、モデル例もご自由に添付していただければ、確認させていただきます。 よろしくお願いいたします。 ドラゴス
View full article
先进的电机控制协处理器 我希望对高级电机控制协处理器有更深入的技术了解。 能否请您向我提供详细描述该外围设备的相关文件和技术介绍? 特别是,如果能说明该模块与双 eFlexPWM / NanoEdge PWM 模块(2×,各 8 个通道)的区别或连接,包括任何功能重叠、交互机制或预期用例,我将不胜感激。 由于高级电机控制协处理器被强调为提供 16 通道可编程 I/O 定时器,而 eflexPWM 代表一组专用的电机控制 PWM 定时器,我想更好地了解这两个子系统在整个电机控制架构中是如何相互补充的。 Re: Adv. MotorControlCo-Processors 你好 通常,参考手册中描述了诸如eTPU、flexPWM、eMIO之类的电机控制定时器的操作。 在S32K39/37/36设备上,恩智浦包括eTPU:一种可编程的微编码定时引擎,具有自己的指令和数据RAM,旨在减轻实时I/O定时任务(PWM波形整形、换向调度、传感器解码、捕获/测量等)。这就是恩智浦材料中所说的 "高级电机控制协处理器"。 在更广泛的 S32K3 系列中,恩智浦重点推出 eMIOS(增强型模块化 I/O 子系统)和 LCU 作为标准电机控制定时器/逻辑组合。eMIOS 是一个高度灵活的 16 位定时器子系统,具有多种通道和模式(缓冲 PWM、中心对齐、死区互补、单脉冲/DAOC、输入捕获等)。由于 eMIOS 每通道占用空间小,边缘处理灵活,因此许多社区文档将其非正式地称为 "NanoEdge PWM "式模块。 如果您使用的是 S32K39 并需要最大限度的确定性或复杂的时间表(解析器、多电机换向、自定义波形),请使用 etPU 作为监控器;将 eflexPWM 连接到功率级;使用 emIO 进行辅助定时/捕获;为 ADC 窗口连接 TRGMUX/BCTU。 如果你使用的是 S32K344/358(没有 eTPU),请为反向器选择 eflexPWM,然后使用 emiOS + LCU/TRGMUX/BCTU 来管理捕获/触发信号/辅助 PWM。RTD 的 PWM 驱动程序可让您在一个配置中混合 eFlexPWM 和 eMIOS 通道。 具体实施可参考以下文献: S32K3xx DS(Rev.13,2025-11-12),设有& 区块。[nxp.com] 用于 eTPU/eMIOS/LCU 的 S32K39/37/36 DS 时序部分。[nxp.com.cn] S32K396 LV MC 套件(明确的 "eTPU 电机控制协处理器")。[nxp.com] S32K3 电机控制手册(名为 eMIOS、LCU、触发信号、ADC/CMP)。[nxp.com]、 S32K3 系列手册(注明 16 位 emiOS 计时器)。[nxp.jp] RTD PWM 驱动器讨论(eFlexPWM 包含在统一 PWM 中)。[community.nxp.com] emiOS 使用指南 & 示例(OPWMB/OPWMCB/DAOC/OPWFMB,捕获模式)。[community.nxp.com] 使用 eMIOS 的单脉冲 PWM(DAOC/OPWMB 示例)。[community.nxp.com] 致以最诚挚的问候, Peter
View full article
汇编程序在 CodeWarrior 中不合法 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好   在使用 mwasmeppc.exe 编译汇编文件时,我遇到了一个问题、这是错误信息:   * 编译 s -> o * ### mwasmeppc.exe Assembler: # File: .\output\obj\cstartup.s # --------------------------------- # 88: e_and2i. # Error: ^^^^^^^^ # 当前目标处理器的指令不合法 ### mwasmeppc.exe 汇编器: # 99: sub r4,r3 # 错误: ^^^^^ # 简化助记符子的参数不足 ### mwasmeppc.exe 汇编器: # 114: e_or2i r31,0x4002 # Error: ^^^^^^ # 对于当前目标处理器,指令不合法   某些命令( e_and2i.sub e_or2i)无法识别,但该文件 cstartup.s 可与其他编译器(Greenhills、Windriver 等)配合使用。   CodeWarrior 版本: 适用于 MPC55xxMPC56xx v2.10。 MCU: XPC560XB CPU 类型为 -proc Zen   我不知道是我错过了一些编译器选项,还是我需要包含一些编译器文件?   顺祝商祺! 思佳 概述 Re: Assembler not legal in CodeWarrior 这是一个有趣的问题!这可能与 CodeWarrior 处理旧版汇编指令或项目设置的方式有关。您可以尝试查看编译器配置,检查是否正确设置了所有汇编路径。要更清楚地了解此类程序或法律文件细节,您可以访问迈阿密戴德在线案例,获取有关结构化流程和案件处理的参考式见解。有时,重温文档标准有助于有效确定缺失的配置。 Re: Assembler not legal in CodeWarrior 如果 CodeWarrior 不支持某些工具或功能(如汇编器),就会很麻烦。要获得有关相关规则和合规性的更多指导或验证,刑事法庭数据等资源有时可以提供有用的参考点。探索替代方法或支持模块可确保开发工作更加顺利。随时了解制约因素有助于防止意外错误并简化编码项目。 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 我已将"答案" 贴到您的另一个主题上。请检查。 此致, Martin Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,马丁、 非常感谢。 我还有一个关于汇编代码的问题https://community.nxp.com/thread/434043你能看看吗? 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 请查看附件,我向您发送的是使用 CW 2.10 生成的一些项目的默认链接器文件。您可以将其作为链接文件的指南。 关于调试信息,这里有部分文档介绍了如何在 .elf 中添加调试信息锉刀希望能对您有所帮助。如果没有,请告诉我,我会尝试不同的解决方案。 ------------------------------------------------------------------------------- 调试控制选项 ------------------------------------------------------------------------------- -g[dwarf] # 全局;套用;生成 DWARF 1.x 调试 # 信息;与"-sym dwarf-1,full "相同 -gdwarf-2 # 全局;套用;生成 DWARF 2.x 调试 # 信息;与"-sym dwarf-2,full" 相同 -sym 关键字[,...] # 全局;指定调试选项 off # 不生成调试信息; # 默认值 on|dwarf-1 # 打开 DWARF 1.x 调试信息 dwarf-2 # 打开 DWARF 2.x 调试信息 ----------------------------------------------------------------------------------------------------- 此致, 马丁 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,马丁、 我修改了 lcf 文件,现在项目可以生成地图和精灵了。 现在 lcf 文件仍然有一些错误,当我使用 Trace32 调试代码时,它找不到启动代码,我怎样才能将启动代码(__entry)定义为 0x0 地址? 另一个问题是,我只能在 Trace32 中看到汇编程序,您知道如何才能在 Trace32 中看到 c 文件吗? 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 MAP 文件看起来不完整。在连接项目时是否有任何错误?您是否能获得 .elf文件?您只共享了一个对象文件,因此我无法尝试链接。 因此,能否请您给我回信,最后能否请您分享您想链接到一起的所有对象文件? 此致, Martin Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,马丁、 这些是 .o文件和地图文件。 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 能否请您分享一下生成的地图文件?为什么您认为地图文件不正确? 能否共享您试图链接的对象文件? 此致, Martin Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,马丁、 我使用的是 mwldeppc。 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 您是使用 CodeWarrior IDE 还是 mwldeppc 命令行工具进行链接? 参考资料 Martin Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 您好, 这些是我使用的链接选项: LINK_OPT += -proc=Zen #mcu 类型;通用 LINK_OPT += -char=unsigned #设置 "char "的符号;必须与编译器匹配。 LINK_OPT += -srec #生成扩展名为 .mot 的 S 记录文件 LINK_OPT += -map #生成地图文件 LINK_OPT += -code_merging=all,aggressive #代码合并优化 LINK_OPT += -far_near_addressing #启用远近寻址优化 LINK_OPT += -vle_enhance_merging #启用 VLE 增强代码合并优化功能 LINK_OPT += -vle_bl_opt LINK_OPT += -abi eabi LINK_OPT += -gdwarf-2 LINK_OPT += -nostdlib LINK_OPT += -m __entry 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 您好, 好的,但现在我无法生成正确的 .Map 文件,是否需要添加一些链接选项?或 .o文件不好吗? 这是生成的地图文件的一部分: __入口的链接地图 代码折叠在文件中:C:\HaoSijia\Projects\498_XPC560XD_XB\test_base\Conformance\IN\Platforms_ConTest_RamNoInit\output\obj\Platforms_ConTest_RamNoInit.o 代码折叠在文件中:C:\HaoSijia\Projects\498_XPC560XD_XB\test_base\Conformance\IN\Platforms_ConTest_RamNoInit\output\obj\main.o 代码折叠在文件中:C:\HaoSijia\Projects\498_XPC560XD_XB\test_base\Conformance\IN\Platforms_ConTest_RamNoInit\output\obj\板.o … 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 是的,你完全可以使用自己的启动程序,而不是 CodeWarrior 启动文件。 此致, Martin Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 您好, 感谢您的解决方案,现在我又遇到了一个关于启动代码的问题: CodeWarrior 有自己的启动文件__start.c and __ppc_eabi_init.c、 我能用自己的启动代码代替这两个文件吗? CodeWarrior 版本:适用于 MPC55xxMPC56xx v2.10。 MCU: XPC560XB 顺祝商祺! 思佳 Re: Assembler not legal in CodeWarrior <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 嗨,思佳、 我看到了一些不一致的地方,可能是你要编译的代码中存在的问题: 1) 指令e_and2i和e_or2i是 VLE,而sub是 BookE。在使用mwasmeppc.exe 时,不可能在一个文件中编译两种指令。 2) 指令子程序必须有三个参数。 有几种解决方案: 1) 最好的办法是用 se_sub 代替 sub 指令,se_sub 是 VLE 指令,需要 2 个参数。不要忘记使用 -vle 选项编译文件。 2) 可以用 BookE 指令替换 VLE 指令,并在子指令中添加第三个参数。 看看附件,我给你发了 bookE 和 VLE 参考手册,其中详细描述了所有说明。 如果您有任何其他问题,请随时给我回信。 此致, Martin Re: Assembler not legal in CodeWarrior 当 CodeWarrior 抛出汇编程序错误时,尤其是当语法中的所有内容似乎都正确时,会令人沮丧。有时,问题会归结为配置或指令丢失,因此仔细检查项目设置会有所帮助。最近,我在研究文档准确性时遇到了里士满法律服务公司,它提醒我,可靠的参考资料在故障排除中是多么重要。希望分享这样的经验能帮助其他人更快地摆脱困境。 Re: Assembler not legal in CodeWarrior 我在尝试使用 CodeWarrior 中的汇编程序时也遇到了同样的问题,这让我非常沮丧。对于任何需要可靠法院信息的人来说,威尔公共记录都是查询备案和案件详细信息的有用资源。它使某些法律问题的解决变得更加容易,而无需依赖零散的资料来源。如果您想快速查阅官方记录,绝对值得一试。
View full article
Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hello Team, I have received the following from Lear: ------------------------------------------------------------------------------------ there is a small problem in the service of “HSE AEAD Service” . I am trying the encrypt in GCM mode : In the Crypto driver the secondary input is a must and is checked against in the Crypto_ProcessJob method (see below array used in Crypto_GetJobErrorForSecondaryInputPtr method) : But in the HSE FW manual the AAD is optional : When I call this : Csm_AEADEncrypt(CsmConf_CsmJob_CsmJob_AES128_ENC_SECCNT_TMP,CRYPTO_OPERATIONMODE_SINGLECALL,&TempPlainTxt[0],16u,NULL_PTR,0u,&TempCipherSecCnt[0],&TagLenPtr,&TempTagSecCnt[0],&TagLenPtr); I get an error that the 2 nd input is a NULL (inside the Crypto_ProcessJob method ..) Can you please check , what to do event if the AAD is optional and not used ? -------------------------------------------------------------------------- BR Stefano Board: S32K344 Component: HSE FW Priority: HIGH SECURITY_CRYPTO Type: ISSUE Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver According to AUTOSAR specifications, AEADENCRYPT and AEADDECRYPT require SecondaryInputPointer and SecondaryLength. Under HSE firmware, these parameters may be ignored later depending on its processing logic. Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver @MarianVilau  @StefanoGattazzo  As discussed with Marian, I moved this ticket to https://jira.sw.nxp.com/browse/CESSCEP-23 to support from our project I will update the feedback on this community soon Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hi @StefanoGattazzo , This ticket is more related to Cuong side. He will help you with this. Thanks, Marian Vilau Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hello, https://jira.sw.nxp.com/browse/FWCRYPTO-198 BR, Marian Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hi MarianVilau, Pls. let me have the ticket number. BR Stefano Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hi @StefanoGattazzo , I created a ticket in the FW Crypto Jira project. BR, Marian Vilau Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hi MarianVilau, what I know, as this is an issue from Lear,  is : JLR ePDU , S32K344 (A/B SWAP HSE FW 0.2.55) I know also they temporary solve the issue with a DummyVariable pointer. BR Stefano Re: Lear - S32k344 - Mismatch btw. Crypto upper and lower driver Hi @StefanoGattazzo , I am analyzing the requirements, will provide response soon. Meanwhile please provide the demo app version and fw version that you use . Regards Marian Vilau
View full article
Zephyr SDKバージョンのインストール Zephyr SDKは、Zephyrアプリケーションをビルドするためのビルド・ツールセットです。GCCやCMakeが含まれており、各Zephyrリリースは特定の Zephyr SDKバージョンに紐づいています。このバージョンは、Zephyrリポジトリ内のSDK_VERSIONファイルに記載されています。推奨されているZephyr SDKバージョンを使用することが重要です。バージョンが一致しないと、ビルド・エラーが発生する可能性があります。 たとえば、Zephyr v4.1はZephyr SDK v0.17.0を指定します。Zephyr SDK v0.17.2(Zephyr v4.2 用)を Zephyr v4.1 で使用すると、ビルドエラーが発生します。Zephyr v4.1 用のアプリをビルドする必要がある場合は、Zephyr SDK v0.17.0をインストールしてください。 複数のZephyr SDKバージョンをインストールしておき、ビルド時に切り替えることが可能です(下記の手順を参照)。 フルインストールと最小インストールの比較 フルインストール(Full Install): すべてのサポートされているSoCアーキテクチャ向けの全ツールチェーンが含まれます。初心者に推奨されますが、より多くのディスク容量とダウンロード時間が必要です。 最小インストール(Minimal Install): 必要なツールチェーンのみを選択できます。スペースと時間を節約できます。 最小インストールの場合は、setup.cmdスクリプトを実行して、インストールするツールを選択します。NXPボードでは、次を選択します。 Zephyr SDK CMakeパッケージを登録する Install host tools aarch64-zephyr-elf (64ビットARM) arm-zephyr-eabi (32ビットARM、NXP MCUを含む) オプション xtensa-nxp… (Cadence Tensilica DSPコア) Zephyr SDKをインストールします これらの手順では、MCUXpresso Installer、CLI(West)、または手動ダウンロードを使用してZephyr SDKをインストールする方法を説明しています。 MCUXpresso Installerを使用したインストール MCUXpresso InstallerはZephyr v4.2からZephyr用パックをサポートし始めました。各パックは対応するZephyr SDKバージョンをインストールします(例:v4.2パックはSDK v0.17.2をインストール)。このオプションはNXP開発用の最小限のツールセットをインストールします。 MCUXpressoインストーラーは、古いZephyr SDKバージョンをサポートしていません。v0.17.1以前の場合は、Westまたは手動インストールを使用してください。 West CLIを使用したインストール Zephyr ProjectはWestにZephyr SDKのインストール機能を追加しました。 CLIの場合は、Python仮想環境をアクティブ化してから、次を実行します。 west sdk install --version 0.17.0   --version が省略された場合、WestはZephyrリポジトリのSDK_VERSIONファイルにあるバージョンを使用します。 デフォルトでは、Fullパッケージがインストールされます。最小のインストールを行う場合は、 -i を追加します。 手動ダウンロードによるインストール https://github.com/zephyrproject-rtos/sdk-ng/releasesから、Zephyr SDKをダウンロードします。 使用するホストOS向けに、FullまたはMinimalを選択します。 WestとMCUXpressoの場合のデフォルトの場所として、ユーザーフォルダーに展開します。 Windows: C:\Users\ \zephyr-sdk-0.17.0 Ubuntu: /home/ /zephyr-sdk-0.17.0 Zephyr SDKのバージョンの選択 複数のZephyr SDKバージョンを共存させることができます。Westはデフォルトで最新バージョンを使用しますが、次の方法で上書きできます。 VS Code: 例をインポートする際は、ウィザードでZephyr SDKバージョンを選択してください。 CLI:環境変数 ZEPHYR_SDK_INSTALL_DIR を、ビルド前に設定します。このコマンドはUbuntuでその変数を設定します。 export ZEPHYR_SDK_INSTALL_DIR="/home/ /zephyr-sdk-0.17.0" またはWindowsの場合: set ZEPHYR_SDK_INSTALL_DIR= C:\Users\ \ zephyr-sdk-0.17.0   Zephyr Knowledge Hubに戻る    
View full article
Linux 嵌入式挑战项目 - 2014 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1. 带行人聚光灯功能的自适应动态大灯 - eVision 团队成员: Balaban Valeriu - 高级微电子学、电子学、UPB 硕士 Voicu Tudor Alexandru - 学士,应用电子,电子,UPB Stanescu Sebastian - 学士,电信网络和软件,UPB 简短描述: 由于夜间事故死亡率高,因此开展了大量研究以开发技术 增加夜间驾驶员的视野范围,并在无法避免的情况下减少事故损失。这 自适应大灯功能有助于在光线不足的情况下,尤其是在弯道中看得更远:转向灯 按照行驶方向旋转前照灯,旋转角度由 CPU 计算,以照亮尽可能多的道路 面积尽可能 一个有趣的解决方案是聚光灯照明功能,它是一种专门照亮潜在危险的 LED 光束。 如果近红外摄像头检测到路边的鹿或道路上的行人,它们就会被短暂地照亮 在远光灯正常覆盖范围之外,用聚光灯提醒驾驶员注意可能存在的危险。 推介会: 请查阅eVisionPresentation.pdf 。 文档: 请查阅eVisionDoc.pdf 。 代码源 https://github.com/izzi/app-evision https://github.com/izzi/meta-evision 2. 人车交互语音控制界面 - She# 团队成员: Iulia Neagoe - 军事技术学院计算机科学与军事信息系统专业 Mihaela-Anca Sorostinean - 军事技术学院计算机科学与军事信息系统 简短描述: 在汽车和通信领域技术不断进步的背景下,驱动因素 责任已经从仅仅控制汽车转变为与汽车提供的众多小工具进行交互 制造商。该项目的目的是设计一个界面,为驾驶员提供控制 通过语音命令来控制汽车的一些非重要功能,以便驾驶员集中注意力 在路上行驶的同时还能与汽车进行舒适的通讯。 我们开发了一个语音识别系统,可以识别收音机、窗户、气候或电话等一些基本功能 我们在 Wandboard 上实现了它。我们还为用户提供了一个公认的图形界面 命令以增强他与车辆的互动。 推介会: 请查阅ShePresentation.pdf 。 文档: 请查阅SheDoc.pdf 。 代码源 请参阅She#_Project_Source.zip。 3. 驾驶控制软件 - FreeSoftwares 团队成员: Petrosanu Adrian-Sabin - 计算机科学,UPB Birsan Nicoleta Cosmina - 计算机科学,UPB Radoi Ioana Gabriela - 计算机科学,UPB 简短描述: 《驾驶控制软件》是一款控制自动变速箱的软件。该项目包括模拟行为 自动变速箱在 Wandboard 上的应用。自动变速箱是一种机动车辆变速箱,可以 随着车辆移动自动改变齿轮比。 推介会: 请查阅FreeSoftwaresPresentation.pdf 。 文档: 请查阅FreeSoftwaresDoc.pdf 。 代码源 请参阅Freesoftwares_Project_Source.zip。 4. 自动泊车 - 通过 ATM 团队成员: Mihai Coca - 军事技术学院计算机科学与军事信息系统专业 格鲁吉亚安德烈 - 军事技术学院计算机科学与军事信息系统 Hiji Iulian -军事技术学院计算机科学与军事信息系统 简短描述: 许多公司正在开发自动驾驶汽车技术,通过将其在该领域的工作应用于 一个特定的用例:停车。该项目的目的是设计一款概念车,它可以停放在 主人把车停在路边,让它自己进入停车位。这个过程甚至可以逆转 当车主准备离开时,汽车会自行停放离开现场,并在路边与钥匙持有者再次会合。 文档: 请查阅ATM Doc.pdf 代码源 请参阅ATM_Project_Source.zip。 5. 碰撞检测 - Beer2.0 团队成员: Nitu Adrian - 计算机科学,UPB 简短描述: 我们项目的目的是让汽车感知前方道路,并使其能够采取预防措施 碰撞;我们希望通过这种方式减少道路上的事故。它将收集来自不同硬件的信号和信息 并会向驾驶员发出警报或立即控制车辆,以便采取关键操作来保护驾驶员 免受任何危及生命的事件的影响。 飞思卡尔杯赛车将配备一个Wandboard和两个USB摄像头,以便我们能够追踪环境。初始之后 对象跟踪我们将通过远程控制融入人机交互。对于这个项目,我们相信一个简单的警告系统 和/或打破就足以作为概念的证明。 推介会: 请参阅Beer20Presentation.pdf 文档: 请查阅Beer20Doc.pdf 代码源 https://bitbucket.org/adriannitu92/freechallenge 6. 使用子带归一化滤波 X LMS 算法实现前馈自适应噪声消除 - Brainiacs 团队成员: Cristian Monea - 电信和信息技术、电子、UPB Madalin Zaharia - 电信和信息技术、电子、UPB 简短说明 本项目提出了一种基于子带归一化滤波X LMS(NFXLMS)的前馈自适应噪声消除(ANC)算法。 使用自适应算法比固定 FIR 或 IIR 滤波器等简单滤波算法具有优势。此外, 汽车环境可以被认为是静止的,因为它保留了一些属性,比如光谱分布、均值、方差,这些属性 允许在汽车噪音消除应用中使用自适应滤波器。 前馈系统应该比反馈系统更有效。在这种情况下,在它之前感测到相干参考噪声输入 传播通过取消扬声器。 因此,该算法将模拟两个传感器(麦克风):参考传感器,用于测量需要消除的主要噪声, 和错误传感器。 推介会: 请参阅BrainiacsPresentation.pdf 文档: 请查阅BrainiacsDoc.pdf 2014年Linux嵌入式挑战赛
View full article
例 S32R274 Watchdog_example S32DS_1.1 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ******************************************************************************** *詳細な説明: * アプリケーションはFCCUとソフトウェアウォッチドッグを初期化します。SWTタイムアウトの期限が切れると、 ※マイコンはリセットされます。 * * マクロLONG_RESETは、どのリセットが実行されるかを定義します。LONG_RESET が 1 の場合、長い ※リセットを行い、それ以外はショートリセットを行います。 * * ------------------------------------------------------------------------------ *テストHW:S32R274RRUEVB、MPC57xxマザーボード ※MCU:S32R274KAMMM 1N58R * Fsys:PLL0 240MHz * Z4コア120MHz *デバッガ:Lauterbach Trace32 * PeMicroのUSB-ML-PPCNEXUS ※対象:internal_FLASH(デバッグモード、debug_ram、リリースモード) * EVB接続:デフォルト * * ******************************************************************************** <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ******************************************************************************** *詳細な説明: * アプリケーションはFCCUとソフトウェアウォッチドッグを初期化します。SWTタイムアウトの期限が切れると、 ※マイコンはリセットされます。 * * マクロLONG_RESETは、どのリセットが実行されるかを定義します。LONG_RESET が 1 の場合、長い ※リセットを行い、それ以外はショートリセットを行います。 * * ------------------------------------------------------------------------------ *テストHW:S32R274RRUEVB、MPC57xxマザーボード ※MCU:S32R274KAMMM 1N58R * Fsys:PLL0 240MHz * Z4コア120MHz *デバッガ:Lauterbach Trace32 * PeMicroのUSB-ML-PPCNEXUS ※対象:internal_FLASH(デバッグモード、debug_ram、リリースモード) * EVB接続:デフォルト * * ********************************************************************************
View full article
示例 MPC5777M MCAN 简单 TX/RX GHS614 ******************************************************************************** * 详细说明: * * 配置 MCAN 来传输和接收 CAN 消息。 * * 在此配置中,MCAN_1 传输一条消息。MCAN_2接收消息。 * * MCAN_1 每 1 秒发送一次消息。该间隔由 PIT 生成。 * 单个 TX 缓冲区用于发送 n 个字节。每次 * 传播。发送两个标准 ID 和 2 个扩展 ID。 * * MCAN_2 配置为接收消息,使用 SW 轮询。 * 定义了2个标准和2个扩展ID过滤表。经典过滤器 * 配置已设置,表示过滤器 ID 和掩码。 * 具有匹配标准 ID 的消息被接收到 RXFIFO_0 中,具有匹配 * 扩展ID然后存储在RXFIFO_1中。 * * EVB连接: * * J37 和 J38 至位置 1-2,将 MCAN1 TX/RX 连接至收发器 * * P15-1 上的 CAN0-CANH 至 P14-1 上的 CAN1-CANH * P15-2 上的 CAN0-CANL 至 P14-2 上的 CAN1-CANL * * ---------------------------------------------------------------------------------------------- * 测试硬件:MPC5777M,MPC57xx主板+MPC5777M_512DS迷你模块 * 掩码组:0N78H * 目标:internal_FLASH * Fsys: 600 MHz PLL1,带 40 MHz 晶振参考, * core2 以 200MHz 的频率由 PPL1 生成 * 终端:无 ******************************************************************************** 修订历史: 1.0 2017年1月5日 PetrS MCAN示例的初始版本 ********************************************************************************************/
View full article
FS65/45XX CAN short to GND function verify and test Because of sometimes customer test fail on CAN short GND function, below shows the test step and result for verify. So need emphasize that EVB only works on debug mode.  Do not confuse about Debug/Normal mode and INIT/Normal mode in the state machine. You can short CAN on EVB every CAN points to GND, but actual in application customer boards sometimes the distance between CAN points and GND is so long and with more noise on bus line. so please take care of this short function should be meet the spec in datasheet.  ----Test 1: Test under INIT mode, CAN short GND function works well. Short CAN_L to GND, has a flag on CANL_.     We can’t write the CAN_LIN_MODE register, only can read.  After read CAN_LIN_MODE register, we find that CAN works on the normal mode.         ----Test 2: Test under normal mode operation after configure INIT_INT register. Short CANL to GND, the CANL_ flag set ‘1’ ,this CAN short to GND works well, without re-set the CAN_LIN_MODE register, then we read the information that CAN works on normal mode.   Setting the CAN in sleep mode then short CANL to GND,can’t detect the fault bit.   Evaluation Board
View full article
AUT-N1761 自动驾驶汽车的第六感 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 为了实现自动驾驶,车辆需要准确地掌握周围的世界——就像人类驾驶员一样。汽车技术的目标是使车辆具备超越人类驾驶员感知的能力,从而能够实时做出最智能的决策。车辆传感器收集的信息不仅必须实时、准确,而且还必须能够抵御黑客攻击,这样我们才能将生命托付给它们。可靠的 ADAS 和适当的安全措施是自动驾驶汽车的关键因素。Vehicle-to-X 技术将可视范围扩展到驾驶员的视线之外,使驾驶员能够“看清”拐角处和障碍物。来自汽车网络的外部传感器信息和内部数据对于帮助消除全球道路上每年发生的 130 万起道路事故至关重要。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 为了实现自动驾驶,车辆需要准确地掌握周围的世界——就像人类驾驶员一样。汽车技术的目标是使车辆具备超越人类驾驶员感知的能力,从而能够实时做出最智能的决策。车辆传感器收集的信息不仅必须实时、准确,而且还必须能够抵御黑客攻击,这样我们才能将生命托付给它们。可靠的 ADAS 和适当的安全措施是自动驾驶汽车的关键因素。Vehicle-to-X 技术将可视范围扩展到驾驶员的视线之外,使驾驶员能够“看清”拐角处和障碍物。来自汽车网络的外部传感器信息和内部数据对于帮助消除全球道路上每年发生的 130 万起道路事故至关重要。 安全互联汽车和自动化汽车
View full article
低功耗模式,带 USB 唤醒 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Kinetis系列具有丰富的低功耗模式。客户可能会感到困惑,不知道如何从低功耗模式唤醒。 1) 在 VLPR、VLPW 中:NVIC 仍然对中断敏感,因此任何中断都会得到服务。 2)在停止、VLPS 状态下:设备只能通过USB唤醒中断唤醒。 3) 在LLS、VLLSx中:设备将无法从任何 USB 源 唤醒 。 4) LLWU 用于 唤醒 ,因此客户可以从任何可用的 LLWU 唤醒 源 唤醒 。 至于 USB模块,对于USB恢复事件有两种不同的中断。一个异步可以从低功耗模式 唤醒 ,由 USB 线路状态 的 变化触发。另一个是同步的,仅在检测到 K 状态(D+ = 0、D- = 1,表示全速)后 2.5 微秒触发。应用程序负责在需要时转换到低功耗模式,为此,它必须检查USB堆栈报告的设备状态。当在总线中检测到挂起条件时,将触发 SLEEP 中断并且堆栈将其状态更改为挂起;然后应用程序将转换到低功耗模式。当发生此 SLEEP 中断时,异步唤醒中断被启用,并在触发时被禁用(这是模块清除中断所必需的)。在正常情况下,同步恢复中断或复位中断将会随后被触发,导致堆栈状态转换为非挂起状态。然后应用程序就可以知道通信再次处于活动状态,并避免再次进入低功耗模式。
View full article
ワイヤレス充電でそのコードを切ることができます! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> スマートフォン、テーブルPC、デジタルスマートウォッチのバッテリー切れのリスクがある場合、またはナイトスタンドやオフィスデスクの間違った充電コードに絡まってしまった場合は、ワイヤーレス充電器のシンプルさが夢の実現です。しかし、ワイヤレス充電器には多くの技術が必要であり、同じように作られているわけではありません。NXPのトランスミッタおよびレシーバコンポーネントのファミリは、Qi規格とRezence規格の両方に対応するソリューションを提供します。私たちは両方を見て、そのコードを切断するためのいくつかの実用的なハードウェアソリューションを提供します。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> スマートフォン、テーブルPC、デジタルスマートウォッチのバッテリー切れのリスクがある場合、またはナイトスタンドやオフィスデスクの間違った充電コードに絡まってしまった場合は、ワイヤーレス充電器のシンプルさが夢の実現です。しかし、ワイヤレス充電器には多くの技術が必要であり、同じように作られているわけではありません。NXPのトランスミッタおよびレシーバコンポーネントのファミリは、Qi規格とRezence規格の両方に対応するソリューションを提供します。私たちは両方を見て、そのコードを切断するためのいくつかの実用的なハードウェアソリューションを提供します。
View full article