Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
How to use the GPU of the NXP Layerscape LS1028A with Yocto    Yocto Project Configuration The most modern and NXP-recommended method for developing with the LS1028A is the Layerscape Linux Distribution POC (LLDP) based on Yocto. Unlike the LSDK (which uses Flexbuild), LLDP uses Yocto/Bitbake and is the long-term supported path. 1 Host Requirements Requirement Details Operating System Ubuntu 20.04 LTS (Focal) — official recommendation RAM Minimum 8 GB (16 GB+ recommended) Disk Space Minimum 100 GB free CPU Minimum 4 cores (more cores = faster builds) Tools git, repo, python3, wget, curl, build-essential Install dependencies on Ubuntu: sudo apt-get update && sudo apt-get install -y  gawk wget git diffstat unzip texinfo gcc-multilib \   build-essential chrpath socat cpio python3 python3-pip  python3-pexpect xz-utils debianutils iputils-ping \   python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev  pylint xterm rsync curl locales zstd liblz4-tool \   repo ca-certificates # Configure git (required by repo) git config --global user.name "Your Name" git config --global user.email "[email protected]" 2 Download the LLDP Repository (Yocto for LS1028A) # Create working directory mkdir ~/lldp-ls1028a && cd ~/lldp-ls1028a # Initialize repo with the LLDP manifest (Kirkstone, kernel 5.15) repo init -u https://github.com/nxp-qoriq/yocto-sdk.git \           -b kirkstone \           -m ls-5.15.71-2.2.0_distro.xml # Sync all repositories (may take 30-60 minutes) repo sync Note: For the latest version (LLDP L6.1.1, kernel 6.1), check the updated manifest at: https://github.com/nxp-qoriq/yocto-sdk 3 Set Up the Build Environment for LS1028A # Initialize Yocto environment for the LS1028A # (run from the lldp-ls1028a/ directory) DISTRO=fsl-qoriq-distro MACHINE=ls1028ardb source distro-setup-env # This automatically creates and enters the build directory # You are now in: ~/lldp-ls1028a/build_ls1028ardb/ 4 local.conf File — GPU Configuration The conf/local.conf file inside the build directory controls compilation options. For the LS1028A with GPU, verify or add: # Edit the configuration file nano conf/local.conf Key parameters for GPU and desktop: # Target machine MACHINE = "ls1028ardb" # Distribution with GPU and Wayland support DISTRO = "fsl-qoriq-distro" # Enable display and GPU features DISTRO_FEATURES:append = " wayland opengl" # GPU driver: use Etnaviv (open-source) for LS1028A # DO NOT use imx-gpu-viv (i.MX only, requires ARCH_MXC) PREFERRED_PROVIDER_virtual/libgl = "mesa" PREFERRED_PROVIDER_virtual/libgles1 = "mesa" PREFERRED_PROVIDER_virtual/libgles2 = "mesa" PREFERRED_PROVIDER_virtual/egl = "mesa" # Enable OpenCL support via Vivante GPU IMAGE_INSTALL:append = " clinfo" # Accept NXP proprietary licenses (required for GPU firmware) LICENSE_FLAGS_ACCEPTED = "nxp-proprietary" # Parallel build threads (adjust to your host PC) BB_NUMBER_THREADS = "8" PARALLEL_MAKE = "-j8" # (Optional) Use ccache to speed up recompilations INHERIT += "ccache" 5 Required Yocto Layers (bblayers.conf) Verify that conf/bblayers.conf includes these layers: cat conf/bblayers.conf It must contain at least: BBLAYERS ?= " \   ${BSPDIR}/sources/poky/meta \   ${BSPDIR}/sources/poky/meta-poky \   ${BSPDIR}/sources/meta-openembedded/meta-oe \   ${BSPDIR}/sources/meta-openembedded/meta-multimedia \   ${BSPDIR}/sources/meta-openembedded/meta-python \   ${BSPDIR}/sources/meta-openembedded/meta-networking \   ${BSPDIR}/sources/meta-freescale \   ${BSPDIR}/sources/meta-qoriq \   ${BSPDIR}/sources/meta-nxp-desktop \ " The meta-nxp-desktop layer is what provides GPU support for the LS1028A with the ls-image-desktop image. 6 Build the Image with GPU Support # Recommended: Desktop image with full GPU support (LS1028A only) # Includes: GNOME desktop, Weston/Wayland, Vivante GPU drivers, OpenCL bitbake ls-image-desktop # Alternative: download all packages first before building # (useful for catching network errors before the long build) bitbake ls-image-desktop --runall fetch bitbake ls-image-desktop # Minimal: main image without desktop (no GPU by default) bitbake ls-image-main # Lite: minimal image bitbake ls-image-lite Estimated build time: Between 4 and 8 hours on the first build (depending on host hardware). Incremental builds are much faster. 7 Install the Image to the SD Card After compilation, output files are located in: tmp/deploy/images/ls1028ardb/ # Identify the SD card (verify with lsblk) lsblk # Install image using flex-installer (included in the SDK) flex-installer \   -b tmp/deploy/images/ls1028ardb/boot_ls1028ardb.tgz \   -f tmp/deploy/images/ls1028ardb/firmware_ls1028ardb_sdboot.img \   -r tmp/deploy/images/ls1028ardb/ls-image-desktop-ls1028ardb.tar.zst \   -d /dev/sdX    # replace with your SD device Practical Example: OpenCL Application on LS1028A This example shows how to compile and run a program that uses the GC7000UL GPU to add two vectors with OpenCL. 8.1 Source Code: vector_add.cl (OpenCL Kernel) Create the kernel file on the LS1028A board: # On the LS1028A (via serial or SSH) cat > /home/root/vector_add.cl << 'EOF' __kernel void vector_add(     __global const float* a,     __global const float* b,     __global float* c,     const int n) {     int gid = get_global_id(0);     if (gid < n) {         c[gid] = a[gid] + b[gid];     } } 8.2 Source Code: vector_add.c (OpenCL Host) cat > /home/root/vector_add.c << 'EOF' #include #include #include #include #define VECTOR_SIZE 1024 int main() {     cl_platform_id   platform;     cl_device_id     device;     cl_context       context;     cl_command_queue queue;     cl_program       program;     cl_kernel        kernel;     cl_mem           buf_a, buf_b, buf_c;     cl_int           err;     // 1. Get Vivante GPU platform and device     err = clGetPlatformIDs(1, &platform, NULL);     err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);     // Print device name     char device_name[128];     clGetDeviceInfo(device, CL_DEVICE_NAME, sizeof(device_name), device_name, NULL);     printf("GPU detected: %s\n", device_name);     // 2. Create context and command queue     context = clCreateContext(NULL, 1, &device, NULL, NULL, &err);     queue   = clCreateCommandQueue(context, device, 0, &err);     // 3. Read kernel source from file     FILE* f = fopen("vector_add.cl", "r");     fseek(f, 0, SEEK_END);     size_t src_size = ftell(f);     rewind(f);     char* src=(char*)malloc(src_size + 1);     fread(src, 1, src_size, f);     src[src_size] = '\0';     fclose(f);     // 4. Compile OpenCL program     program = clCreateProgramWithSource(context, 1, (const char**)&src, &src_size, &err);     err = clBuildProgram(program, 1, &device, NULL, NULL, NULL);     if (err != CL_SUCCESS) {         char log[2048];         clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG,                               sizeof(log), log, NULL);         printf("Compilation error:\n%s\n", log);         return 1;     }     kernel = clCreateKernel(program, "vector_add", &err);     // 5. Prepare input data     float* h_a = (float*)malloc(VECTOR_SIZE * sizeof(float));     float* h_b = (float*)malloc(VECTOR_SIZE * sizeof(float));     float* h_c = (float*)malloc(VECTOR_SIZE * sizeof(float));     for (int i = 0; i < VECTOR_SIZE; i++) {         h_a[i] = (float)i;         h_b[i] = (float)(VECTOR_SIZE - i);     }     // 6. Create GPU buffers     buf_a = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,                            VECTOR_SIZE * sizeof(float), h_a, &err);     buf_b = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,                            VECTOR_SIZE * sizeof(float), h_b, &err);     buf_c = clCreateBuffer(context, CL_MEM_WRITE_ONLY,                            VECTOR_SIZE * sizeof(float), NULL, &err);     // 7. Set kernel arguments and execute on GPU     int n = VECTOR_SIZE;     clSetKernelArg(kernel, 0, sizeof(cl_mem), &buf_a);     clSetKernelArg(kernel, 1, sizeof(cl_mem), &buf_b);     clSetKernelArg(kernel, 2, sizeof(cl_mem), &buf_c);     clSetKernelArg(kernel, 3, sizeof(int), &n);     size_t global_size = VECTOR_SIZE;     err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL,                                   &global_size, NULL, 0, NULL, NULL);     clFinish(queue);     // 8. Read result     clEnqueueReadBuffer(queue, buf_c, CL_TRUE, 0,                         VECTOR_SIZE * sizeof(float), h_c, 0, NULL, NULL);     // 9. Verify result (each element should equal VECTOR_SIZE = 1024)     int ok = 1;     for (int i = 0; i < VECTOR_SIZE; i++) {         if (h_c[i] != (float)VECTOR_SIZE) { ok = 0; break; }     }     printf("Result: %s\n", ok ? "CORRECT - GPU works!" : "CALCULATION ERROR");     printf("Example: a[0]=%.0f + b[0]=%.0f = c[0]=%.0f\n",            h_a[0], h_b[0], h_c[0]);     // Free resources     clReleaseMemObject(buf_a); clReleaseMemObject(buf_b); clReleaseMemObject(buf_c);     clReleaseKernel(kernel); clReleaseProgram(program);     clReleaseCommandQueue(queue); clReleaseContext(context);     free(h_a); free(h_b); free(h_c); free(src);     return 0; } 8.3 Compile and Run on the LS1028A On the LS1028A board (connected via serial or SSH): # Install build tools and OpenCL headers apt-get install -y gcc clinfo ocl-icd-libopencl1 opencl-headers # Compile gcc -o vector_add vector_add.c -lOpenCL -I/usr/include # Run ./vector_add Expected output: GPU detected: Vivante OpenCL Device GC7000UL.6202.0000 Result: CORRECT - GPU works! Example: a[0]=0 + b[0]=1024 = c[0]=1024 12.4 Yocto Recipe to Include the Example in the Image To include the example directly in the Yocto image, create a recipe in your custom layer: mkdir -p ~/lldp-ls1028a/sources/meta-my-layer/recipes-examples/opencl-vector/files cp vector_add.c vector_add.cl \    ~/lldp-ls1028a/sources/meta-my-layer/recipes-examples/opencl-vector/files/ Recipe file opencl-vector_1.0.bb: SUMMARY = "OpenCL vector addition example for LS1028A GPU" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://vector_add.c \            file://vector_add.cl" DEPENDS = "virtual/opencl-icd opencl-headers" S = "${WORKDIR}" do_compile() {     ${CC} ${CFLAGS} -o vector_add vector_add.c -lOpenCL ${LDFLAGS} } do_install() {     install -d ${D}${bindir}     install -m 0755 vector_add ${D}${bindir}/     install -d ${D}/home/root     install -m 0644 vector_add.cl ${D}/home/root/ } FILES:${PN} += "/home/root/vector_add.cl" Add to local.conf and rebuild: IMAGE_INSTALL:append = " opencl-vector" bitbake ls-image-desktop Practical Example: OpenGL ES Rendering with Wayland/Weston This example shows how to render an animated triangle using OpenGL ES 2.0 with EGL on the Weston (Wayland) compositor — the standard "Hello World" of embedded graphics on the GC7000UL GPU. 9.1 Graphics Stack Diagram C Application      ↓ OpenGL ES 2.0  (libGLESv2.so — Vivante GC7000UL)      ↓ EGL 1.4        (libEGL.so — interface between GLES and Wayland)      ↓ Wayland Client (libwayland-client, libwayland-egl)      ↓ Weston Compositor (DRM/KMS + Mali-DP500)      ↓ DisplayPort → 4K Monitor 9.2 Install Dependencies On the LS1028A (with ls-image-desktop): apt-get install -y libgles2-mesa-dev libegl1-mesa-dev libwayland-dev libwayland-egl-backend-dev gcc pkg-config 9.3 Source Code: triangle_gles.c cat > /home/root/triangle_gles.c << 'EOF' /**  * OpenGL ES 2.0 + EGL + Wayland example  * Renders a colored spinning triangle on the Vivante GC7000UL GPU of the LS1028A  * Compile: gcc -o triangle_gles triangle_gles.c -lwayland-client -lwayland-egl -lEGL -lGLESv2 -lm  */ #include #include #include #include #include #include #include #include #define WIDTH  800 #define HEIGHT 600 static struct wl_display       *wl_display    = NULL; static struct wl_compositor    *wl_compositor = NULL; static struct wl_shell         *wl_shell      = NULL; static struct wl_surface       *wl_surface    = NULL; static struct wl_shell_surface *shell_surface = NULL; static struct wl_egl_window    *egl_window    = NULL; static EGLDisplay egl_display; static EGLContext egl_context; static EGLSurface egl_surface; static const char *vertex_shader_src=     "attribute vec2 a_position;          \n"     "attribute vec3 a_color;             \n"     "varying vec3 v_color;               \n"     "uniform float u_angle;              \n"     "void main() {                       \n"     "  float c = cos(u_angle);           \n"     "  float s = sin(u_angle);           \n"     "  vec2 rot = vec2(                  \n"     "    a_position.x*c - a_position.y*s,\n"     "    a_position.x*s + a_position.y*c \n"     "  );                                \n"     "  gl_Position = vec4(rot, 0.0, 1.0);\n"     "  v_color = a_color;                \n"     "}                                   \n"; static const char *fragment_shader_src=     "precision mediump float;            \n"     "varying vec3 v_color;               \n"     "void main() {                       \n"     "  gl_FragColor = vec4(v_color, 1.0);\n"     "}                                   \n"; /* Vertices: position (x,y) + color (r,g,b) */ static const float vertices[] = {      0.0f,  0.8f,  1.0f, 0.0f, 0.0f,   /* Top    - Red   */     -0.7f, -0.5f,  0.0f, 1.0f, 0.0f,   /* Left   - Green */      0.7f, -0.5f,  0.0f, 0.0f, 1.0f,   /* Right  - Blue  */ }; static void registry_global(void *data, struct wl_registry *reg,                              uint32_t name, const char *iface, uint32_t ver) {     if (strcmp(iface, "wl_compositor") == 0)         wl_compositor = wl_registry_bind(reg, name, &wl_compositor_interface, 1);     else if (strcmp(iface, "wl_shell") == 0)         wl_shell = wl_registry_bind(reg, name, &wl_shell_interface, 1); } static void registry_global_remove(void *d, struct wl_registry *r, uint32_t n) {} static const struct wl_registry_listener registry_listener = {     registry_global, registry_global_remove }; static GLuint compile_shader(GLenum type, const char *src) {     GLuint shader = glCreateShader(type);     glShaderSource(shader, 1, &src, NULL);     glCompileShader(shader);     GLint ok; glGetShaderiv(shader, GL_COMPILE_STATUS, &ok);     if (!ok) {         char log[512]; glGetShaderInfoLog(shader, 512, NULL, log);         printf("Shader error: %s\n", log); exit(1);     }     return shader; } int main() {     wl_display = wl_display_connect(NULL);     if (!wl_display) { printf("Error: could not connect to Wayland\n"); return 1; }     struct wl_registry *registry = wl_display_get_registry(wl_display);     wl_registry_add_listener(registry, &registry_listener, NULL);     wl_display_dispatch(wl_display);     wl_display_roundtrip(wl_display);     wl_surface = wl_compositor_create_surface(wl_compositor);     shell_surface = wl_shell_get_shell_surface(wl_shell, wl_surface);     wl_shell_surface_set_toplevel(shell_surface);     egl_display = eglGetDisplay((EGLNativeDisplayType)wl_display);     eglInitialize(egl_display, NULL, NULL);     eglBindAPI(EGL_OPENGL_ES_API);     EGLint config_attribs[] = {         EGL_SURFACE_TYPE,    EGL_WINDOW_BIT,         EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,         EGL_RED_SIZE,   8, EGL_GREEN_SIZE, 8,         EGL_BLUE_SIZE,  8, EGL_ALPHA_SIZE, 0,         EGL_DEPTH_SIZE, 16, EGL_NONE     };     EGLConfig egl_config; EGLint num_configs;     eglChooseConfig(egl_display, config_attribs, &egl_config, 1, &num_configs);     EGLint ctx_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };     egl_context = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, ctx_attribs);     egl_window  = wl_egl_window_create(wl_surface, WIDTH, HEIGHT);     egl_surface = eglCreateWindowSurface(egl_display, egl_config,                                           (EGLNativeWindowType)egl_window, NULL);     eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);     printf("GPU: %s\n", glGetString(GL_RENDERER));     printf("OpenGL ES Version: %s\n", glGetString(GL_VERSION));     GLuint vs = compile_shader(GL_VERTEX_SHADER,   vertex_shader_src);     GLuint fs = compile_shader(GL_FRAGMENT_SHADER, fragment_shader_src);     GLuint program = glCreateProgram();     glAttachShader(program, vs); glAttachShader(program, fs);     glLinkProgram(program); glUseProgram(program);     GLint pos_loc   = glGetAttribLocation(program,  "a_position");     GLint color_loc = glGetAttribLocation(program,  "a_color");     GLint angle_loc = glGetUniformLocation(program, "u_angle");     glViewport(0, 0, WIDTH, HEIGHT);     float angle = 0.0f;     int frames = 0;     printf("Rendering spinning triangle (Ctrl+C to exit)...\n");     while (1) {         wl_display_dispatch_pending(wl_display);         glClearColor(0.1f, 0.1f, 0.15f, 1.0f);         glClear(GL_COLOR_BUFFER_BIT);         glUniform1f(angle_loc, angle);         glEnableVertexAttribArray(pos_loc);         glVertexAttribPointer(pos_loc,   2, GL_FLOAT, GL_FALSE, 5*sizeof(float), vertices);         glEnableVertexAttribArray(color_loc);         glVertexAttribPointer(color_loc, 3, GL_FLOAT, GL_FALSE, 5*sizeof(float), vertices + 2);         glDrawArrays(GL_TRIANGLES, 0, 3);         eglSwapBuffers(egl_display, egl_surface);         angle += 0.02f;         if (angle > 6.2832f) angle -= 6.2832f;         frames++;         if (frames % 300 == 0)             printf("Frame %d — angle: %.2f rad\n", frames, angle);     }     eglDestroyContext(egl_display, egl_context);     eglDestroySurface(egl_display, egl_surface);     eglTerminate(egl_display);     wl_display_disconnect(wl_display);     return 0; } 9.4 Compile and Run # Compile gcc -o triangle_gles triangle_gles.c \     -lwayland-client -lwayland-egl \     -lEGL -lGLESv2 -lm # Make sure Weston is running and set Wayland environment export XDG_RUNTIME_DIR=/run/user/0 export WAYLAND_DISPLAY=wayland-0 # Run ./triangle_gles Expected terminal output: GPU: Vivante GC7000UL OpenGL ES Version: OpenGL ES 3.1 V6.4.3.p4.398061 Rendering spinning triangle (Ctrl+C to exit)... Frame 300 — angle: 6.00 rad Frame 600 — angle: 5.68 rad A RGB triangle spinning on a dark background will appear on screen, rendered by the GC7000UL GPU. Bio_TICFSL_0-1789407894776.png 9.5 Yocto Recipe SUMMARY = "OpenGL ES 2.0 spinning triangle example — LS1028A" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://triangle_gles.c" DEPENDS = "virtual/libgles2 virtual/egl wayland" S = "${WORKDIR}" do_compile() {     ${CC} ${CFLAGS} -o triangle_gles triangle_gles.c \         -lwayland-client -lwayland-egl -lEGL -lGLESv2 -lm ${LDFLAGS} } do_install() {     install -d ${D}${bindir}     install -m 0755 triangle_gles ${D}${bindir}/ } 9.6 Yocto Recipe for OpenCV with GPU Add to local.conf: IMAGE_INSTALL:append = " opencv python3-opencv" PACKAGECONFIG:append:pn-opencv = " opencl" bitbake ls-image-desktop Regards
View full article
EL2 Monitor: Simplifying Software Partitioning for Automotive Safety Systems The automotive industry is undergoing a fundamental architectural shift. Where vehicles once relied on dozens of dedicated ECUs — one function, one controller — modern designs are consolidating multiple software functions onto a single, powerful processor. This consolidation reduces cost, weight, and complexity, but it introduces a critical challenge: how do you run a safety-critical AUTOSAR brake control application on the same chip as a less-critical body control stack, and guarantee they can never interfere with each other? Full hypervisors are one answer — but they come with significant drawbacks. They are complex to integrate, expensive to license, difficult to certify to ISO 26262, and introduce latency that real-time systems cannot tolerate. NXP's EL2 Monitor (EL2M) was designed to solve exactly this problem: delivering robust, hardware-enforced software isolation with the simplicity, determinism, and safety pedigree that automotive programs demand. What Is EL2 Monitor? EL2 Monitor is a partitioning hypervisor that runs at Exception Level 2 (EL2) — the hypervisor privilege level defined by the Arm® architecture — on Arm® Cortex®-R52 cores. It sits between the hardware and the application software, acting as a lightweight isolation layer that enforces strict boundaries between software partitions running on the same processor. In simple terms: EL2 Monitor takes a single physical processor and divides it into independent, isolated software environments — called R52 partitions — each running its own RTOS instance with exclusive access to its assigned resources. A fault, crash, or security breach in one partition cannot affect any other. Unlike a full hypervisor, EL2 Monitor does not perform CPU scheduling, device virtualization, or dynamic resource management. Its scope is deliberately narrow: isolate partitions, protect shared hardware resources, and do so in a way that is statically configured, deterministic, and certifiable to ASIL D. This focused design philosophy is what makes it practical for production automotive programs. The Core Problem: The Shared GIC Distributor To understand why EL2 Monitor exists, it helps to understand a specific hardware constraint of the Arm Cortex-R52 architecture. In an R52-based Real-Time Unit (RTU), every two or four cores share a single GIC (Generic Interrupt Controller) Distributor — the hardware block that routes interrupts to cores. Without protection, any software running on one core has direct access to the GIC Distributor and could — accidentally or maliciously — reroute or disable interrupts belonging to another core's partition. This makes true isolation impossible without a dedicated software layer at EL2. EL2 Monitor fills this gap. It intercepts all GIC Distributor accesses from partitions and virtualizes them, giving each partition its own exclusive Virtual GIC Distributor while the real hardware GIC remains protected. How It Works: Two Virtualization Modes   Trap & Emulate GIC Distributor accesses from EL1 software are automatically trapped to EL2, where EL2 Monitor validates and emulates them. The EL1 application is completely unaware of the virtualization — it behaves as if it has exclusive hardware access. Access operations complete in < 3 µs, making this mode suitable for standard AUTOSAR applications that require zero code changes.   Paravirtualization For performance-sensitive applications, EL2 Monitor provides ready-to-use Arm CMSIS GIC Driver APIs. The EL1 software calls these APIs directly instead of accessing GIC hardware registers. This cooperative approach achieves < 1.5 µs latency — half that of full emulation — while also reducing memory usage and development time. Hardware-Enforced Memory Protection Beyond GIC virtualization, EL2 Monitor uses the EL2 Memory Protection Unit (MPU) to enforce strict memory boundaries between partitions in hardware. Each partition is assigned its own memory regions at configuration time. Even if an EL1 guest OS is compromised, it cannot access memory belonging to another partition. This is complemented by NXP's XRDC (Extended Resource Domain Controller) silicon feature, creating a layered hardware + software protection architecture that is unique to NXP's S32 platform. MRU Channel Isolation EL2 Monitor also virtualizes MRU (Messaging Resource Unit) channels within each R52 partition. Each software entity running at a lower privilege level accesses the MRU through its own dedicated virtualized instance — inter-core communication channels cannot be accessed or corrupted by other software entities. MRU handlers are serviced in < 1.5 µs. Static, Deterministic Configuration All partition assignments — CPU cores, memory regions, peripherals, interrupt routing — are defined at build time using the EB Tresos or S32CT configuration plugins. There is no runtime reconfiguration, no dynamic scheduling, and no hidden shared state. This static model makes system behavior fully predictable, simplifies safety analysis, and keeps the trusted computing base small and auditable. Safety and Quality EL2 Monitor is qualified to ASIL D per ISO 26262:2018 — the highest automotive functional safety integrity level. Development follows NXP's Software Development Process, which is Automotive SPICE 3.1 · IATF 16949:2016 · ISO 26262:2018 · ISO 21434:2021 · ISO 9001:2015 compliant. The complete package delivered to customers includes: Quality Package: SW Traceability Matrix (Req → Design → Code → Tests), Test Specs & Reports at all levels, MISRA/CERT-C/CWE Static Analysis, Code Coverage, Benchmark & Memory Reports Safety Package: Safety Manual, FMEA Software Package: Source code, Release Notes, User Manual, SBOM Development teams do not need to perform their own safety analysis of the partitioning layer — NXP provides the complete collateral, significantly reducing the certification effort for the overall system. Developer Experience: Fits Into Your Existing Workflow EB Tresos and S32CT plugins for AUTOSAR-based configuration S32 Design Studio (S32DS) for build, debug, and deployment Multi-compiler support for toolchain flexibility Sample application included to accelerate first-time integration Available via the NXP software distribution portal (Flexera) 6 on-demand training videos on nxp.com: Hello World, Configuration & Build, RTOS Integration, Download & Install, Tools & Compilers, Support Channels Supported Platforms Why EL2 Monitor — and Why Now? The industry trend toward software-defined vehicles and centralized compute is accelerating. Zonal and domain controllers are replacing distributed ECU networks, and the software running on these controllers is growing in both complexity and safety criticality. The need for a reliable, certified, and cost-effective partitioning solution has never been more urgent. ASIL D certified — highest automotive safety integrity level, full collateral included Simpler than a full hypervisor — static, deterministic, minimal trusted computing base Unique NXP HW+SW stack — XRDC hardware isolation + EL2 Monitor software protection Sub-1.5 µs performance — paravirtualized GIC access Production-ready — full safety collateral, AUTOSAR toolchain integration, multi-platform Explore EL2 Monitor and discover how NXP's partitioning software can help you consolidate your automotive software architecture — safely, simply, and at no additional cost. Learn more about EL2 Monitor on nxp.com » Daniel Hermenczi Product Owner, EL2 Monitor — System Services, Automotive & Edge Solutions, NXP Semiconductors Daniel is a software project manager and product owner for EL2 Monitor and IPCF at NXP Semiconductors, driving roadmap execution and customer deliveries for automotive partitioning and inter-platform communication software. He is based in Sibiu, Romania. As vehicles consolidate more software onto fewer chips, keeping safety-critical functions truly isolated is no longer optional. EL2 Monitor delivers hardware-enforced partitioning for Arm® Cortex®-R52 — without the complexity of a full hypervisor.
View full article
Compile & Deployment DeepLabV3 with Ara Model Zoo v1.0.0   Compile & Deployment DeepLabV3 with Ara Model Zoo v1.0.0
View full article
仅可使用钥匙扣/智能卡登录 我在一家制造公司工作,我们正在考虑在车间配备个人电脑,以便员工能够查看零件图纸、确认任务完成情况等等。由于我们希望尽可能减少员工的痛苦,但又要记录谁签署了任务,因此我们正在寻找最佳方式,让员工使用他们已有的门禁卡来开门和打卡。如果这不可行,我们当然愿意考虑其他方案,让员工可以使用某种物理令牌登录,而无需接触键盘或鼠标,更不用说记住用户名和密码了。我研究过智能卡,但它们似乎需要输入密码,而我们希望尽可能避免使用密码。我们了解其中固有的网络安全风险,这些设备将被锁定,只能执行特定任务,而不能访问网络的其他部分。 移动设备上的智能卡 Re: Login with keyfob/smartcard only 我建议使用 MIFARE DESFire EV3。 以下是网页链接: MIFARE DESFire EV3 | 安全免接触式集成电路 | 恩智浦半导体 Re: Login with keyfob/smartcard only 我打算惹恼恩智浦半导体的人,建议他们采用带有指纹识别器的FIDO2密钥令牌。几乎所有操作系统都原生支持 FIDO2,或者可以通过轻松安装的插件支持。 在令牌上添加指纹读取器,可以实现令牌与特定人员的绑定,同时还能保持相当流畅的运行。令牌格式分为信用卡格式和加密狗格式。前者通常可与接触式读卡器或 NFC 读卡器配合使用——后者通常是 USB 令牌、免接触式令牌或二者的组合。
View full article
キーフォブ/スマートカードでのみログインできます 私は製造会社で働いており、従業員が部品図面を見たり、タスク完了のサインをしたりできるように、工場の現場にPCを設置しようと考えています。できるだけ手間を軽くしつつ、誰がタスクにサインしたかの記録も残したいため、従業員がすでに持っているアクセスコントロールバッジを使ってドアへのアクセスや出退勤をする最適な方法を検討しています。もしそれが現実的でなければ、従業員が物理的なトークンでログインし、キーボードやマウスに触れることなく、ユーザー名やパスワードを覚える必要もない、他の選択肢も検討しています。スマートカードについて調べてみましたが、PINコードが必要なようで、できれば避けたいと思っています。私たちは固有のセキュリティリスクを理解しており、これらのデバイスは特定のタスクしか実行できず、ネットワークの他の部分にアクセスできないようにロックダウンされます。 モバイルのスマートカード Re: Login with keyfob/smartcard only MIFARE DESFire EV3をおすすめします。 こちらのウェブページはこちらです:MIFARE DESFire EV3 |セキュア非接触IC |NXP Semiconductors Re: Login with keyfob/smartcard only NXPの担当者を困らせるかもしれないが、指紋リーダーを内蔵したFIDO2キートークンを提案してみようと思う。ほとんどのOSはFIDO2を自然にサポートするか、簡単にインストールできるプラグインで対応しています。 トークンに指紋認証機能を追加することで、トークンを特定の人物に紐付けつつも、非常にスムーズに動作させることができる。トークンの形式は、クレジットカード型とドングル型がある。前者は通常、コンタクト・リーダまたはNFCリーダーのいずれかで動作し、後者は通常USBトークン、非接触トークン、またはコンボのいずれかです。
View full article
Login with keyfob/smartcard only I work in a manufacturing company and we're looking at putting PCs out on the shop floor for employees to be able to do things like look at parts drawings, sign off that tasks are completed etc. As we want this to be as painless as possible but still have a record of who is signing off on the tasks, we are looking at the best way for the employees to use the access control badges they already have for accessing doors and clocking in and out. If that's not feasible we're certainly open to other options that would allow the employees to log in with some kind of physical token and never have to touch a keyboard or mouse let alone remember user names and passwords. I've looked into smart cards, but it appears that they require a PIN which we want to avoid if at all possible. We understand the inherant security risks and these devices would be locked down to only be able to do specific tasks and not have access to another parts of the network. Smart Cards on Mobile Re: Login with keyfob/smartcard only I would suggest the MIFARE DESFire EV3. Here is the web page: MIFARE DESFire EV3 | Secure Contactless IC | NXP Semiconductors Re: Login with keyfob/smartcard only I'm going to annoy the NXP folks and instead suggest a FIDO2 key token which includes a fingerprint reader.  Most all of the various OS's support FIDO2 organically, or with an easily installed plugin. The addition of the fingerprint reader to the token allows the token to be locked to a specific person but still work fairly seamlessly.  The token formats come in credit card or dongle formats.  The former usually works either with a contact reader or NFC reader - the latter is usually either a USB token, a contactless token or a combo.
View full article
LEARNING I am new to NXP S32K144. What is the recommended development environment for a beginner, and what should I learn first? Re: LEARNING Hello @JASAMANG , For a beginner, I recommend using S32 Design Studio for S32 Platform together with an S32K144 evaluation board. In addition to the IDE, please install the S32K1 Real-Time Drivers (RTD) package. For the current development flow, the recommended combination is S32 Design Studio v3.6.0 with S32K1 RTD 3.0.0. The RTD package can be installed through Help > S32DS Extensions and Updates. I suggest following this learning path: Import and run an existing S32K144 RTD example, such as a blinking LED or GPIO example. Learn the basic project structure, build process, flashing, and debugging. Become familiar with the S32 Configuration Tools, particularly pin, clock, and peripheral configuration. Continue with GPIO, interrupts, timers, PWM, and ADC. Once these fundamentals are clear, proceed to motor-control examples and tools such as FreeMASTER and MCAT. Starting from an existing example is generally easier than creating the complete application from scratch. For RTD installation guidance, please refer to the S32K1 RTD offline installation guide. Although the article demonstrates an older S32DS/RTD combination, it explains the package dependencies and the general offline installation flow. Always verify the required S32DS version and dependent packages in the release notes of the RTD version you download. You may also find this discussion useful: Install SDK/RTD into S32 Design Studio. It explains the difference between the legacy SDK and RTD and provides links to both AUTOSAR and non-AUTOSAR blinking LED examples You may also find useful examples and technical articles in the S32K Knowledge Base.  If you encounter a problem, I recommend searching the S32K Community forum first. Many common questions and issues have already been discussed and answered there.  Also, please create a dedicated thread if you encounter a specific issue. This helps keep us the discussions clear and makes it easier for other users to find relevant information.   We actively monitor threads for seven days after the last reply. After that period,  we only receive subscription emails for updates and those can occasionally be missed. For any related questions after this period, please create a new thread and refer to the original one.   If a response answers your question, please click “Accept as Solution.” For any related questions please create a new thread and refer to the original one.   Best regards, Pavel Re: LEARNING Information Appreciated 🙏 Re: LEARNING I really appreciate the information 🙏 
View full article
フラッシュドライブ # 今 マーケット で一番良いフラッシュドライブはどれか ## どうか教えて Re: Flash Drives こんにちは、@ reedjhn9 あなたの質問の意味がよく分かりませんでした。具体的に、使用している製品と知りたい具体的な問題について教えていただけますか?
View full article
PIC CLBのユーレカ 特定のPIC MCU(例:pic16f13145ファミリ)には、Configurable Logic Blockと呼ばれるFPGA風のプログラム可能なロジックがあります。 私が使用しているpic16f13115は、それぞれ4入力ルックアップテーブルとDフリップフロップを備えた32個のセルで構成されています。 ツールの使い方を学ぶために、今日はPWM明るさ制御付き6つのLEDのチャーリープレックス対応を実装し、シミュレーションしました。ロジックCADキャンバスを使用する代わりに、Verilogを使用して回路を定義しました。 私は時間の半分くらいを壁に頭を打ち付けて過ごしていた。少しずつ、Verilogを正しく記述し、合成(ビルド)を行い、そしてシミュレーションを実行できるようにした。 CLBでプログラムされたロジックがCPUがスリープ状態でも動作するのは素晴らしい。セーフティに関わるアプリケーションに最適です。例えば、複雑な割り込みトリガーロジックの実装に利用できます。CLBロジックをペリフェラルに接続する際の柔軟性は非常に高いです。これは、PICの定番となっている、扱いにくいCLCプログラマブルロジックよりもはるかに柔軟性が高い。 私のEureka体験を共有したかっただけです。 パワー
View full article
Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() A customer reported an issue related to the use of the iMX8MP GPU (drawing using EGL). When the process that initializes the GPU previously called mlockall(MCL_FUTURE), as soon as the CMA area is mapped into userspace, the kernel reports the following BUG(): Kernel BUG at remap_pfn_range_internal+0x23c/0x2c8 Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP CPU: 0 PID: 3197 Comm: galcore_window_ Tainted: G O 6.6.142-7.7.0-devel #1-Torizon Hardware name: Toradex Verdin iMX8M Plus WB on Verdin Development Board (DT) pc : remap_pfn_range_internal+0x23c/0x2c8 x27: 00000000a2100000 x20: 0068000000000fcb x19: 0000007f90000000 ^^^^^^^^^^^^^^^^^^^^^^ the PTE already present Call trace: remap_pfn_range_internal+0x23c/0x2c8 remap_pfn_range+0x24/0x58 dma_direct_mmap+0xf4/0x150 dma_mmap_attrs+0x18/0x3c _CMAFSLMapUser+0x9c/0x150 [galcore] gckOS_LockPages+0xe4/0x148 [galcore] gckKERNEL_MapVideoMemory+0x90/0x1dc [galcore] gckVIDMEM_NODE_LockCPU+0x1b4/0x250 [galcore] _LockVideoMemory.isra.0+0x1f4/0x28c [galcore] gckKERNEL_Dispatch+0x210/0x1730 [galcore] gckDEVICE_Dispatch+0xcc/0x220 [galcore] drv_ioctl+0x340/0x444 [galcore] __arm64_sys_ioctl+0xac/0xf0 Kernel panic - not syncing: Oops - BUG: Fatal exception mlockall(MCL_FUTURE) is commonly used by real time applications, and the customer who reported the issue is using CODESYS to drive their HMI. We executed an AI-assisted analysis of the issue, and uncovered a plausible explanation for the reason the issue is being triggered: The CMA allocator in the galcore driver doesn't include an .mmap() hook. During the _CMAFSLMapUser() execution, it calls mmap() to get a vma, which is then used to locate the CMA area using find_vma(). The way mmap() is called causes the kernel to lazilly allocate a SHM area to fullfil the request. In normal cases, this allocation gets discarded moments later when the CMA are is found and remapped. However, when MCL_FUTURE is active the kernel cannot lazilly allocate the SHM area anymore, so it goes and populates the entire area before mmap() returns. In this case we have valid pages on this address, and the later call to remap_pfn_range() would end up silently discarding the memory management housekeeping information, which is exactly what the BUG() prevents. I'll attach a zip file which contains the source code of a program that reproduces the issue consistently without the need to run CODESYS. The AI agent suggested the following patch to fix it: diff -uNr a/hal/kernel/inc/gc_hal_options.h b/hal/kernel/inc/gc_hal_options.h --- a/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:00:44.596621860 +0000 +++ b/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:01:15.643862002 +0000 @@ -1471,9 +1471,17 @@ * Enable this macro can replace the /dev/zero by anon_inode: * [galcore] in /proc/ /maps. * Without the macro, run 'cat /proc/ /maps' will print "/dev/zero". + * + * It is also what gives the allocators an ->mmap handler, which is + * required so that the reservation made by vm_mmap() is created as a + * device mapping (VM_IO | VM_PFNMAP) rather than as ordinary anonymous + * memory. Without it, a process that has called mlockall(MCL_FUTURE) + * gets the range pre-faulted inside vm_mmap(), and the subsequent + * remap_pfn_range() then hits BUG_ON(!pte_none()) in remap_pte_range(). + * See tmp_mmap() in gc_hal_kernel_allocator.c. */ #ifndef gcdANON_FILE_FOR_ALLOCATOR -# define gcdANON_FILE_FOR_ALLOCATOR 0 +# define gcdANON_FILE_FOR_ALLOCATOR 1 #endif /* diff -uNr a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c --- a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:00:44.605314869 +0000 +++ b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:01:15.644216883 +0000 @@ -400,7 +400,13 @@ gcmkHEADER_ARG("Allocator=%p Mdl=%p Cacheable=%d", Allocator, Mdl, Cacheable); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) +#if gcdANON_FILE_FOR_ALLOCATOR + /* Same as the gfp, dma and reserved_mem allocators: go through the + * allocator's anon file so that its ->mmap handler runs. */ + userLogical = (gctPOINTER)vm_mmap(Allocator->anon_file, +# else userLogical = (gctPOINTER)vm_mmap(gcvNULL, +# endif 0L, Mdl->numPages * PAGE_SIZE, PROT_READ | PROT_WRITE, diff -uNr a/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/hal/os/linux/kernel/gc_hal_kernel_allocator.c --- a/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:00:44.603242857 +0000 +++ b/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:01:15.644041018 +0000 @@ -104,6 +104,36 @@ static int tmp_mmap(struct file *fp, struct vm_area_struct *vma) { + /* + * Declare the reservation as a device mapping with raw PFNs, before + * mmap() returns it to the caller. remap_pfn_range() sets both flags + * anyway; setting them here only makes them effective from the moment + * the VMA is created, and that is what matters: + * + * - the kernel treats VM_IO | VM_PFNMAP as VM_SPECIAL, documented in + * include/linux/mm.h as "Special vmas that are non-mergable, + * non-mlock()able". mmap_region() therefore clears VM_LOCKED from + * this VMA and leaves mm->locked_vm alone, and __mm_populate() + * skips it outright ("if (vma->vm_flags & (VM_IO | VM_PFNMAP)) + * continue;" in mm/gup.c). + * + * - so a process that has called mlockall(MCL_FUTURE) no longer has + * this range pre-faulted inside vm_mmap(). Every other mapping in + * that process keeps being locked and pre-faulted as before; only + * device memory, which is neither pageable nor swappable and gains + * nothing from being pre-faulted, is left out. + * + * - and the allocator's own remap_pfn_range(), a few microseconds + * later, therefore finds an empty range instead of one the kernel + * has just populated, so it no longer trips + * BUG_ON(!pte_none(ptep_get(pte))) in remap_pte_range(). + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + vm_flags_set(vma, VM_IO | VM_PFNMAP); +#else + vma->vm_flags |= VM_IO | VM_PFNMAP; +#endif + return 0; } The upstream driver uses a different mechanism which bypasses this issue. Other galcore allocators use the same pattern (calling vm_mmap to get a vma) and thus are likely succeptible to the same BUG(). Could you please look into this and fix the galcore driver? This issue prevents a real use case from working properly, and is affecting our customer directly. Thank you, Rafael Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Hi @rbeims  Let me run the test and then check with the GPU team. Best Regards, Zhiming Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Hi @Zhiming_Liu , did you manage to reproduce the bug? If yes, do you have an ETA when the fix will be implemented in your BSP? Thanks.   Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Hi @alvaro_tx  Our internal team tested this patch. Although it directly resolved the issue encountered by the customer, it caused problems during testing in other applications. We are still investigating the matter and have not reached a final conclusion. Best Regards, Zhiming Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Hi @Zhiming_Liu , thanks for the clear report. Fully understood, and we also thought this could happen. All good.  Please keep working on this and let us know with any updates.  Thank you, Alvaro.  Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Dear @Zhiming_Liu , any progress on the investigation?  If there is no progress, could you let us know what problems caused during testing in other applications? The customer needs to advance on their development and is considering applying the patch if there is no official solution, but they want to know the downsides. Thank you, Alvaro.  Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Hi @alvaro_tx  @rbeims  Regarding the issue the customer mentioned, the relevant patch is currently being merged; however, I see that the patch from NXP R&D is based on the EGL library, not the Linux driver. Best Regards, Zhiming Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() Thanks @Zhiming_Liu .  I see that the patch from NXP R&D is based on the EGL library, not the Linux driver. Does it mean that the change will be applied to the closed source EGL library and not the open source Linux driver?  If you don't plan to open the patch, any information on where the patch be applied would be appreciated, specially what Linux kernel (6.6, 6.18?).  Should we understand that the R&D team confirmed that the patch solves this issue even if it is not the same approach than the workaround? 
View full article
S32K3X8EVB-Q289HWUMのオープンボードデバッガを用いた外部MCU(S32K358)のプログラミング こんにちは、 外部MCU S32K358を、S32K3X8EVB-Q289HWUMボードのオンボードデバッガと20ピンのCortex Debug D ETMコネクタに接続し、J55ケーブルケーブルを使ってプログラムしようとしています。しかし、エラーが発生します。コントローラーをうまくプログラムするために実際に何をすればいいのか教えてください。 Yash2530_0-1789183591258.jpegYash2530_0-1789183591258.jpeg CMD>VC オブジェクトファイルのCRC-16をデバイス範囲と照合しています... ブロック 00400000-0042F4B7 ... 計算されたCRC-16がブロックと一致しません。(ファイル = $A9EE、デバイス = $EDEF) デバイスのフラッシュメモリの検証エラー Flashプログラミング中にエラーが発生しました。 情報: DAP IDCODE = 0x6BA02477 情報:DAPの電源投入に成功しました。DP CTRL/STAT = 0xF0000000 リセットスクリプトを開始します (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac)... REM MC_MEモジュールで選択したコアのクロックを有効にする 200ミリ秒遅延します... 終わり。 REM RAMとDMAを初期化します。 REM DMA TCD の初期化: REM 使用する各コアに対して、有効な実行可能コードをRAMにコピーします。 REM MC_ME で必要なコアを有効にする: 20ミリ秒遅延します... 終わり。 20ミリ秒遅延します... 終わり。 リセットスクリプト (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac)完了しました。 PEmicro GDB 起動失敗: フラッシュプログラミング中にエラーが発生しました。デバッグセッションを終了します。 PEエラー:デバイスへのダウンロード中にエラーが発生しました。デバッグセッションを終了します。 127.0.0.1 経由で「127.0.0.1」から切断されました。ポート「53100」による6224からの切断 PEエラー: エラー: 応答を送信しようとしましたが、接続が既に閉じられています。 127.0.0.1 経由で「127.0.0.1」から切断されました。ポート「53104」による7224からの切断 情報: DAP IDCODE = 0x6BA02477 ターゲットとの接続が切断されました。 よろしくお願いいたします。 ヤシュ・グプタ Re: Programming External MCU (S32K358) using open board debugger of S32K3X8EVB-Q289HWUM ハイ まず第一に、オンボードデバッガーの使用はお勧めしません。S32K3X8EVBのオンボードデバッガは、評価ボード上でMCUのプログラミングとデバッグを行うために設計されています。このデバッガを使って外部カスタムS32K358ボードをプログラムまたはデバッグすることは、PEmicroによる公式推奨のユースケースではありません。したがって、NXPはこの構成での適切な動作を保証することはできません。 オンボードデバッガに関する制限事項については、以前に「 S32K142-Q48のプログラム/デバッグに関する問題」という議論の中で言及しました。PEmicroがS32K3オンボードデバッガの制限を変更したかどうかは把握していません。 たとえPEmicroにそのような制限がなくても、オンボードS32K358がデバッグャインターフェース回路を通じて電源供給されていないか(オンボードVDD_HV_A、VDD_HV_B、V11などを測定して確認)、またはJTAG_TCLK/SWD_CLKラインがオンボードS32K358から切り離されているかを必ず確認してください。 さらに、オンボードのデバッガインターフェースの信号電圧がカスタムボードの電圧と一致しているかも確認する必要があります。 よろしくお願いいたします ロビン
View full article
使用 S32K3X8EVB-Q289HWUM 的开放式板调试器对外部 MCU (S32K358) 进行编程 你好, 我正在尝试使用连接到 20 针 Cortex Debug D ETM 连接器的 S32K3X8EVB-Q289HWUM 板的板载调试器,以及 J55 电缆,对我的外部 MCU S32K358 进行编程。但我遇到了错误。请告诉我我究竟需要做些什么才能成功对我的控制器进行编程。 Yash2530_0-1789183591258.jpegYash2530_0-1789183591258.jpeg CMD>VC 正在验证目标文件 CRC-16 校验值是否与设备范围匹配…… 区块 00400000-0042F4B7 ... 计算出的 CRC-16 值与数据块不匹配。(文件 = $A9EE,设备 = $EDEF) 验证设备闪存时出错 Flash编程过程中发生错误。 信息:DAP IDCODE = 0x6BA02477 信息:DAP 已成功启动。DP CTRL/STAT = 0xF0000000 启动 RESET 脚本 (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac)... REM 启用 MC_ME 模块中选定内核的时钟 延迟200毫秒…… 完毕。 REM 初始化 RAM 和 DMA: REM 初始化 DMA TCD: REM 将有效的可执行代码复制到每个要使用的核心的 RAM 中。 REM 启用 MC_ME 中所需的内核: 延迟20毫秒…… 完毕。 延迟20毫秒…… 完毕。 重置脚本 (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac)完全的。 PEmicro GDB 启动失败:闪存编程期间出错。调试会话结束。 PE错误:下载到设备时出错。调试会话结束。 通过 127.0.0.1 与“127.0.0.1”断开连接。通过端口“53100”与6224断开连接 PE-ERROR:错误:尝试发送响应,但连接已关闭。 通过 127.0.0.1 与“127.0.0.1”断开连接。通过端口“53104”与7224断开连接 信息:DAP IDCODE = 0x6BA02477 目标设备已断开连接。 问候, 亚什·古普塔 Re: Programming External MCU (S32K358) using open board debugger of S32K3X8EVB-Q289HWUM HI 首先,我不建议使用板载调试器。S32K3X8EVB 板载调试器设计用于在评估板上对 MCU 进行编程和调试。使用此调试器对外部定制的 S32K358 板进行编程或调试并非 PEmicro 官方推荐的使用场景;因此,NXP 无法保证在此配置下正常运行。 关于板载调试器的局限性,之前在“ S32K142-Q48 的程序/调试问题”讨论中已经提到过。我不知道 PEmicro 是否更改了 S32K3 板载调试器的限制。 即使 PEmicro 没有此类限制,您仍然必须确保板载 S32K358 没有通过调试器接口电路供电(通过测量板载 VDD_HV_A、VDD_HV_B、V11 等进行验证),或者 JTAG_TCLK/SWD_CLK 线已与板载 S32K358 断开。 此外,您还需要验证板载调试器接口的信号电压是否与您的定制板上的电压相匹配。 此致敬礼, Robin
View full article
在调用 mlockall(MCL_FUTURE) 的进程中使用 iMX8MP GPU 会导致内核 BUG() 一位客户报告了一个与使用 iMX8MP GPU(使用 EGL 绘图)相关的问题。当初始化 GPU 的进程先前调用 mlockall(MCL_FUTURE) 时,一旦 CMA 区域被映射到用户空间,内核就会报告以下 BUG(): Kernel BUG at remap_pfn_range_internal+0x23c/0x2c8 Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP CPU: 0 PID: 3197 Comm: galcore_window_ Tainted: G O 6.6.142-7.7.0-devel #1-Torizon Hardware name: Toradex Verdin iMX8M Plus WB on Verdin Development Board (DT) pc : remap_pfn_range_internal+0x23c/0x2c8 x27: 00000000a2100000 x20: 0068000000000fcb x19: 0000007f90000000 ^^^^^^^^^^^^^^^^^^^^^^ the PTE already present Call trace: remap_pfn_range_internal+0x23c/0x2c8 remap_pfn_range+0x24/0x58 dma_direct_mmap+0xf4/0x150 dma_mmap_attrs+0x18/0x3c _CMAFSLMapUser+0x9c/0x150 [galcore] gckOS_LockPages+0xe4/0x148 [galcore] gckKERNEL_MapVideoMemory+0x90/0x1dc [galcore] gckVIDMEM_NODE_LockCPU+0x1b4/0x250 [galcore] _LockVideoMemory.isra.0+0x1f4/0x28c [galcore] gckKERNEL_Dispatch+0x210/0x1730 [galcore] gckDEVICE_Dispatch+0xcc/0x220 [galcore] drv_ioctl+0x340/0x444 [galcore] __arm64_sys_ioctl+0xac/0xf0 Kernel panic - not syncing: Oops - BUG: Fatal exception mlockall(MCL_FUTURE) 通常用于实时应用程序,而报告此问题的客户正在使用 CODESYS 来驱动其 HMI。 我们利用人工智能辅助分析了该问题,并找到了该问题触发原因的合理解释: galcore 驱动程序中的 CMA 分配器不包含 .mmap() 方法。钩。在 _CMAFSLMapUser() 执行期间,它调用 mmap() 获取 vma,然后使用该 vma 通过 find_vma() 定位 CMA 区域。mmap() 的调用方式导致内核延迟分配 SHM 区域以满足请求。正常情况下,当找到 CMA 区域并重新映射时,此分配会在片刻后被丢弃。 但是,当 MCL_FUTURE 处于活动状态时,内核不能再延迟分配 SHM 区域,因此它会在 mmap() 返回之前填充整个区域。在这种情况下,该地址上有有效的页面,而稍后对 remap_pfn_range() 的调用最终会默默地丢弃内存管理维护信息,这正是 BUG() 所阻止的。 我将附上一个 zip 文件,其中包含一个程序的源代码,该程序可以稳定地重现该问题,而无需运行 CODESYS。AI代理建议使用以下补丁来修复此问题: diff -uNr a/hal/kernel/inc/gc_hal_options.h b/hal/kernel/inc/gc_hal_options.h --- a/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:00:44.596621860 +0000 +++ b/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:01:15.643862002 +0000 @@ -1471,9 +1471,17 @@ * Enable this macro can replace the /dev/zero by anon_inode: * [galcore] in /proc/ /maps. * Without the macro, run 'cat /proc/ /maps' will print "/dev/zero". + * + * It is also what gives the allocators an ->mmap handler, which is + * required so that the reservation made by vm_mmap() is created as a + * device mapping (VM_IO | VM_PFNMAP) rather than as ordinary anonymous + * memory. Without it, a process that has called mlockall(MCL_FUTURE) + * gets the range pre-faulted inside vm_mmap(), and the subsequent + * remap_pfn_range() then hits BUG_ON(!pte_none()) in remap_pte_range(). + * See tmp_mmap() in gc_hal_kernel_allocator.c. */ #ifndef gcdANON_FILE_FOR_ALLOCATOR -# define gcdANON_FILE_FOR_ALLOCATOR 0 +# define gcdANON_FILE_FOR_ALLOCATOR 1 #endif /* diff -uNr a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c --- a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:00:44.605314869 +0000 +++ b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:01:15.644216883 +0000 @@ -400,7 +400,13 @@ gcmkHEADER_ARG("Allocator=%p Mdl=%p Cacheable=%d", Allocator, Mdl, Cacheable); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) +#if gcdANON_FILE_FOR_ALLOCATOR + /* Same as the gfp, dma and reserved_mem allocators: go through the + * allocator's anon file so that its ->mmap handler runs. */ + userLogical = (gctPOINTER)vm_mmap(Allocator->anon_file, +# else userLogical = (gctPOINTER)vm_mmap(gcvNULL, +# endif 0L, Mdl->numPages * PAGE_SIZE, PROT_READ | PROT_WRITE, diff -uNr a/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/hal/os/linux/kernel/gc_hal_kernel_allocator.c --- a/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:00:44.603242857 +0000 +++ b/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:01:15.644041018 +0000 @@ -104,6 +104,36 @@ static int tmp_mmap(struct file *fp, struct vm_area_struct *vma) { + /* + * Declare the reservation as a device mapping with raw PFNs, before + * mmap() returns it to the caller. remap_pfn_range() sets both flags + * anyway; setting them here only makes them effective from the moment + * the VMA is created, and that is what matters: + * + * - the kernel treats VM_IO | VM_PFNMAP as VM_SPECIAL, documented in + * include/linux/mm.h as "Special vmas that are non-mergable, + * non-mlock()able". mmap_region() therefore clears VM_LOCKED from + * this VMA and leaves mm->locked_vm alone, and __mm_populate() + * skips it outright ("if (vma->vm_flags & (VM_IO | VM_PFNMAP)) + * continue;" in mm/gup.c). + * + * - so a process that has called mlockall(MCL_FUTURE) no longer has + * this range pre-faulted inside vm_mmap(). Every other mapping in + * that process keeps being locked and pre-faulted as before; only + * device memory, which is neither pageable nor swappable and gains + * nothing from being pre-faulted, is left out. + * + * - and the allocator's own remap_pfn_range(), a few microseconds + * later, therefore finds an empty range instead of one the kernel + * has just populated, so it no longer trips + * BUG_ON(!pte_none(ptep_get(pte))) in remap_pte_range(). + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + vm_flags_set(vma, VM_IO | VM_PFNMAP); +#else + vma->vm_flags |= VM_IO | VM_PFNMAP; +#endif + return 0; } 上游驱动程序使用了一种不同的机制来绕过这个问题。其他 galcore 分配器使用相同的模式(调用 vm_mmap 获取 vma),因此很可能容易受到相同的 BUG() 的影响。 请您调查并修复 galcore 驱动程序?这个问题导致实际应用场景无法正常运行,直接影响到我们的客户。 谢谢! 拉斐尔 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() 嗨@rbeims 让我先运行一下测试,然后再和GPU团队确认。 此致, 志明 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() @Zhiming_Liu ,你好,请问你成功复现了这个bug吗?如果可以,请问预计何时能在BSP中实现该修复?谢谢。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() 您好@Zhiming_Liu ,感谢您提供的清晰报告。完全理解,我们也预料到这种情况会发生。一切都好。 请继续推进这项工作,如有任何进展,请与我们联系。 谢谢你, 阿尔瓦罗。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() 嗨@alvaro_tx 我们的内部团队测试了这个补丁。虽然它直接解决了客户遇到的问题,但在其他应用程序的测试过程中却造成了问题。我们仍在调查此事,尚未得出最终结论。 此致, 志明 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() @Zhiming_Liu ,调查有进展吗? 如果没有进展,能否与我们联系,告知您在其他应用程序测试过程中遇到了哪些问题? 客户需要推进开发工作,如果官方没有解决方案,他们正在考虑应用此补丁,但他们想知道其缺点。 谢谢你, 阿尔瓦罗。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() 嗨@alvaro_tx @rbeims 关于客户提到的问题,相关的补丁目前正在合并中;但是,我发现 NXP R&D 的补丁是基于 EGL 库,而不是 Linux 驱动程序。 此致, 志明 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() 谢谢@Zhiming_Liu 。 我发现 NXP 研发部门提供的补丁是基于 EGL 库,而不是 Linux 驱动程序。 这是否意味着这项更改将应用于闭源的EGL库,而不是开源的Linux驱动程序? 如果您不打算公开此补丁,请告知我们补丁的应用范围,特别是Linux内核版本(6.6、6.18?)。 我们是否可以理解为,研发团队已经确认,即使补丁方案与之前的变通方法不同,它也能解决这个问题?
View full article
S32 Design Studio for Power Architecture 版本 2.1激活码即将开始 您好,我的产品为S32 Design Studio for Power Architecture Version 2.1,激活码B9B6-A787-E3B4-585C即将于9.28日继续,请帮我续期或允许重新申请 Re: S32 Design Studio for Power Architecture Version 2.1激活码即将到期 你好, 您的S32DS许可证已延期。请将现有许可证存入S32DS系统,并使用您之前的激活码重新激活。
View full article
S32 Design Studio for Power Architecture Version 2.1激活码即将到期 您好,我的产品为S32 Design Studio for Power Architecture Version 2.1,激活码 B9B6-A787-E3B4-585C 即将于9.28日到期,请帮我续期或允许重新申请 Re: S32 Design Studio for Power Architecture Version 2.1激活码即将到期 Hi,  your S32DS license has been extended. Please return existing license in S32DS and activate it again with your old code. 
View full article
Programming External MCU (S32K358) using open board debugger of S32K3X8EVB-Q289HWUM Hello,  I am trying to program my external MCU S32K358 using an onboard debugger of S32K3X8EVB-Q289HWUM board connected at 20-pin Cortex Debug D ETM connector, along with cable J55 cable. But I get errors. Please let me know what I actually need to do to successfully program my controller. Yash2530_0-1789183591258.jpegYash2530_0-1789183591258.jpeg CMD>VC Verifying object file CRC-16 to device ranges ... block 00400000-0042F4B7 ... Calculated CRC-16 does not match block. (File = $A9EE, Device = $EDEF) Error verifying flash of device Error occured during Flash programming. INFO: DAP IDCODE = 0x6BA02477 INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000 Starting reset script (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) ... REM Enable clocks for selected cores in MC_ME module Delaying for 200mS ... Done. REM Initialize RAM and DMA: REM Initialize DMA TCD: REM Copy valid executable code to RAM for each core to be used. REM Enable required cores in MC_ME: Delaying for 20mS ... Done. Delaying for 20mS ... Done. Reset script (C:\NXP\S32DS.3.6.7\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_6.1.8.202603121731\supportFiles_ARM\NXP\S32K3xx\S32K358.mac) completed. PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session. PE-ERROR: Error downloading to the device. Terminating debug session. Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "53100" from 6224 PE-ERROR: Error : Attempted to send response but connection already closed. Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "53104" from 7224 INFO: DAP IDCODE = 0x6BA02477 Target Disconnected. Regards, Yash Gupta Re: Programming External MCU (S32K358) using open board debugger of S32K3X8EVB-Q289HWUM Hi First of all, I do not recommend using the onboard debugger. The onboard debugger on the S32K3X8EVB is designed for programming and debugging the MCU on the evaluation board itself. Using this debugger to program or debug an external custom S32K358 board is not an officially recommended use case by PEmicro; therefore, NXP cannot guarantee proper operation in this configuration. Limitations regarding the onboard debugger were previously mentioned in the "Program/Debug issue with S32K142-Q48" discussion. I am not aware if PEmicro has changed the limitations for the S32K3 onboard debugger. Even if there are no such limitations from PEmicro, you must still ensure that the onboard S32K358 is not being powered through the debugger interface circuitry (verify by measuring onboard VDD_HV_A, VDD_HV_B, V11, etc.) or that the JTAG_TCLK/SWD_CLK lines are disconnected from the onboard S32K358. Additionally, you need to verify that the signal voltage of the onboard debugger interface matches the voltage on your custom board. Best Regards, Robin
View full article
S32 Design Studio for Power Architecture バージョン 2.1激活码即将到期 您好,我的产品为S32 Design Studio for Power Architecture Version 2.1,激活码 B9B6-A787-E3B4-585C 即将于9.28日到期,请帮我续期或允许重新申请 Re: S32 Design Studio for Power Architecture Version 2.1激活码即将到期 こんにちは、 お客様のS32DSライセンスが延長されました。S32DSに既存のライセンスを返却し、以前のコードで再度アクティベートしてください。
View full article
Flash Drives # which is best flash drive avialble now in the market ## Please tell me Re: Flash Drives Hi@reedjhn9 I didn't quite understand your question. Could you describe it in more detail—specifically, the product you are using and the exact issue you want to know about?
View full article
U盘 目前市面上最好的U盘是哪一款? ## 请告诉我 Re: Flash Drives 你好@ reedjhn9 我不太明白你的问题。您能否更详细地描述一下——具体来说,您正在使用的产品以及您想了解的具体问题?
View full article
mlockall(MCL_FUTURE)を呼び出すプロセスでiMX8MP GPUを使用すると、カーネルBUG() あるお客様がiMX8MPのGPU使用(EGLによる描画)に関する問題を報告しました。以前mlockall(MCL_FUTURE)と呼ばれていたGPU初期化プロセスが、CMA領域がユーザースペースにマッピングされると、カーネルは以下のBUG()を報告します: Kernel BUG at remap_pfn_range_internal+0x23c/0x2c8 Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP CPU: 0 PID: 3197 Comm: galcore_window_ Tainted: G O 6.6.142-7.7.0-devel #1-Torizon Hardware name: Toradex Verdin iMX8M Plus WB on Verdin Development Board (DT) pc : remap_pfn_range_internal+0x23c/0x2c8 x27: 00000000a2100000 x20: 0068000000000fcb x19: 0000007f90000000 ^^^^^^^^^^^^^^^^^^^^^^ the PTE already present Call trace: remap_pfn_range_internal+0x23c/0x2c8 remap_pfn_range+0x24/0x58 dma_direct_mmap+0xf4/0x150 dma_mmap_attrs+0x18/0x3c _CMAFSLMapUser+0x9c/0x150 [galcore] gckOS_LockPages+0xe4/0x148 [galcore] gckKERNEL_MapVideoMemory+0x90/0x1dc [galcore] gckVIDMEM_NODE_LockCPU+0x1b4/0x250 [galcore] _LockVideoMemory.isra.0+0x1f4/0x28c [galcore] gckKERNEL_Dispatch+0x210/0x1730 [galcore] gckDEVICE_Dispatch+0xcc/0x220 [galcore] drv_ioctl+0x340/0x444 [galcore] __arm64_sys_ioctl+0xac/0xf0 Kernel panic - not syncing: Oops - BUG: Fatal exception mlockall(MCL_FUTURE)はリアルタイムアプリケーションで一般的に使われており、問題を報告した顧客はCODESYSを使ってHMIを駆動しています。 AIを活用した分析を実施した結果、問題が発生する理由として考えられる説明が明らかになりました。 galcoreドライバーのCMAアロケーターには.mmap()が含まれていません。フック。_CMAFSLMapUser() の実行中に、mmap() を呼び出して vma を取得し、それを使用して find_vma() を使用して CMA 領域を特定します。mmap() の呼び出し方法により、カーネルは要求を満たすために SHM 領域を遅延的に割り当てることになります。通常の場合、CMAが見つかって再マッピングされると、この割り当てはすぐに破棄されます。 しかし、MCL_FUTUREがアクティブなとカーネルはもはやSHM領域を怠惰に割り当てることができなくなり、mmap()が戻る前にエリア全体を埋め尽くします。この場合、このアドレスには有効なページがあり、後のremap_pfn_range()への呼び出しはメモリ管理のハウスキーピング情報を静かに破棄することになり、これはまさにBUG()が防いでいることです。 CODESYSを実行せずに問題を再現できるプログラムのソースコードを含むzipファイルを添付します。AIエージェントは、この問題を修正するために以下のパッチを提案しました。 diff -uNr a/hal/kernel/inc/gc_hal_options.h b/hal/kernel/inc/gc_hal_options.h --- a/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:00:44.596621860 +0000 +++ b/hal/kernel/inc/gc_hal_options.h 2026-09-04 13:01:15.643862002 +0000 @@ -1471,9 +1471,17 @@ * Enable this macro can replace the /dev/zero by anon_inode: * [galcore] in /proc/ /maps. * Without the macro, run 'cat /proc/ /maps' will print "/dev/zero". + * + * It is also what gives the allocators an ->mmap handler, which is + * required so that the reservation made by vm_mmap() is created as a + * device mapping (VM_IO | VM_PFNMAP) rather than as ordinary anonymous + * memory. Without it, a process that has called mlockall(MCL_FUTURE) + * gets the range pre-faulted inside vm_mmap(), and the subsequent + * remap_pfn_range() then hits BUG_ON(!pte_none()) in remap_pte_range(). + * See tmp_mmap() in gc_hal_kernel_allocator.c. */ #ifndef gcdANON_FILE_FOR_ALLOCATOR -# define gcdANON_FILE_FOR_ALLOCATOR 0 +# define gcdANON_FILE_FOR_ALLOCATOR 1 #endif /* diff -uNr a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c --- a/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:00:44.605314869 +0000 +++ b/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c 2026-09-04 13:01:15.644216883 +0000 @@ -400,7 +400,13 @@ gcmkHEADER_ARG("Allocator=%p Mdl=%p Cacheable=%d", Allocator, Mdl, Cacheable); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) +#if gcdANON_FILE_FOR_ALLOCATOR + /* Same as the gfp, dma and reserved_mem allocators: go through the + * allocator's anon file so that its ->mmap handler runs. */ + userLogical = (gctPOINTER)vm_mmap(Allocator->anon_file, +# else userLogical = (gctPOINTER)vm_mmap(gcvNULL, +# endif 0L, Mdl->numPages * PAGE_SIZE, PROT_READ | PROT_WRITE, diff -uNr a/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/hal/os/linux/kernel/gc_hal_kernel_allocator.c --- a/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:00:44.603242857 +0000 +++ b/hal/os/linux/kernel/gc_hal_kernel_allocator.c 2026-09-04 13:01:15.644041018 +0000 @@ -104,6 +104,36 @@ static int tmp_mmap(struct file *fp, struct vm_area_struct *vma) { + /* + * Declare the reservation as a device mapping with raw PFNs, before + * mmap() returns it to the caller. remap_pfn_range() sets both flags + * anyway; setting them here only makes them effective from the moment + * the VMA is created, and that is what matters: + * + * - the kernel treats VM_IO | VM_PFNMAP as VM_SPECIAL, documented in + * include/linux/mm.h as "Special vmas that are non-mergable, + * non-mlock()able". mmap_region() therefore clears VM_LOCKED from + * this VMA and leaves mm->locked_vm alone, and __mm_populate() + * skips it outright ("if (vma->vm_flags & (VM_IO | VM_PFNMAP)) + * continue;" in mm/gup.c). + * + * - so a process that has called mlockall(MCL_FUTURE) no longer has + * this range pre-faulted inside vm_mmap(). Every other mapping in + * that process keeps being locked and pre-faulted as before; only + * device memory, which is neither pageable nor swappable and gains + * nothing from being pre-faulted, is left out. + * + * - and the allocator's own remap_pfn_range(), a few microseconds + * later, therefore finds an empty range instead of one the kernel + * has just populated, so it no longer trips + * BUG_ON(!pte_none(ptep_get(pte))) in remap_pte_range(). + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + vm_flags_set(vma, VM_IO | VM_PFNMAP); +#else + vma->vm_flags |= VM_IO | VM_PFNMAP; +#endif + return 0; } 上流ドライバーはこの問題を回避する別のメカニズムを使用しています。他の galcore アロケータも同じパターン (vm_mmap を呼び出して vma を取得する) を使用しているため、同じ BUG() の影響を受ける可能性があります。 この件について調べて、galcoreドライバーを直してもらえますか?この問題は実際のユースケースが正常に動作することを妨げており、直接的にお客様に影響を及ぼしています。 ありがとうございました。 ラファエル Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() こんにちは@rbeims  テストを実行してからGPUチームに確認させてください。 よろしくお願いします、 志明 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() こんにちは、 @Zhiming_Liu さん、バグを再現できましたか?はいの場合、修正が貴社のBSPに実装される予定時期を教えていただけますか? よろしくお願いいたします。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() こんにちは、 @alvaro_tx さん。 社内チームがこのパッチをテストしました。お客様が直面した問題を直接解決したものの、他のアプリケーションのテスト中に問題を引き起こしました。現在も調査中であり、最終的な結論には至っていません。 よろしくお願いします、 志明 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() こんにちは、 @Zhiming_Liu さん。分かりやすいレポートをありがとうございます。完全に理解していて、私たちもこれが起こり得ると思いました。すべて順調です。 引き続きこの件に取り組んでいただき、進捗状況があればお知らせください。 ありがとう、 アルバロ。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() @Zhiming_Liu さん、調査の進捗状況はいかがですか? 進展がなければ、他のアプリケーションでテスト中にどのような問題が生じたのか教えていただけますか? お客様は開発を進める必要があり、公式な解決策がなければパッチの適用を検討していますが、デメリットを知りたいと考えています。 ありがとう、 アルバロ。 Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() ありがとう@Zhiming_Liu 。 NXPのR&DのパッチはLinuxドライバではなくEGLライブラリに基づいているようです。 この変更はオープンソースのLinuxドライバではなく、クローズドソースのEGLライブラリに適用されるということでしょうか? パッチを開く予定がない場合は、パッチが適用される場所、特にLinuxカーネル(6.6、6.18?)についての情報を教えていただけると助かります。 研究開発チームは、回避策とは異なるアプローチであっても、このパッチが問題を解決することを確認したと理解すべきでしょうか? Re: Using iMX8MP GPU on a process that call mlockall(MCL_FUTURE) causes kernel BUG() こんにちは、 @alvaro_tx @rbeims お客様が言及した問題についてですが、該当パッチは現在マージ中です。しかし、NXP R&DのパッチはLinuxドライバではなくEGLライブラリに基づいているようです。 よろしくお願いします、 志明
View full article