# SPE configuration Xavier NX

**URL:** <https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293>\
**Category:** Jetson Xavier NX\
**Tags:** spe, gpio\
**Created:** [March 25, 2024, 4:58pm UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293 "2024-03-25T16:58:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andres.artavia](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andres.artavia/32/273049_2.png) [@andres.artavia](https://forums.developer.nvidia.com/u/andres.artavia)\
**Post date:** [March 25, 2024, 4:58pm UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/1 "2024-03-25T16:58:51Z")

</div>

Hi,  
I’m trying to understand SPE on Xavier NX, and had a couple of questions.

1. Currently we are working with a carrier that needs a gpio to be up even when the Jetson is powered off. After reading the docs, if i understand correctly SPE should work right?
2. Also I modified the gpio example to toogle the gpio line that I need:

- spe-freertos-bsp/rt-aux-cpu-demo-fsp/soc/t19x/include/can-aon-force.h

```auto
#ifndef _GPIO_AON_T19X_H
#define _GPIO_AON_T19X_H

#include <soc/t194/aon/processor/tegra-gpio-hw.h>

#define TEGRA_AON_GPIO_CHIP_ID 0
#define TEGRA_AON_GPIO_ID(bank, gpio) \
		gpio_global_id(TEGRA_AON_GPIO_CHIP_ID, TEGRA_GPIO(bank, gpio))

#define GPIO_CAN_TX TEGRA_AON_GPIO_ID(AA, 2) /* GPIO_AA 2, pin 145 */

#endif

```

- spe-freertos-bsp/rt-aux-cpu-demo-fsp/app/can-tx-force.h

```auto

void can_force_app_init(void);

```

- spe-freertos-bsp/rt-aux-cpu-demo-fsp/app/can-tx-force.c

```auto

#include <err-hook.h>
#include <printf-isr.h>
#include <stdio.h>
#include <osa/rtos-task.h>
#include <gpio/tegra-gpio.h>

/* can-aon-force.h has GPIO_APP* defines */
#include "can-aon-force.h"
#include "can-tx-force.h"

#define GPIO_OUT_SET_DELAY	5000

static bool toogle_gpio = false;

static void gpio_app_task(void *pvParameters)
{
	(void)pvParameters;
	int val;

	val = tegra_gpio_direction_out(GPIO_CAN_TX, 0);
	if (val) {
		error_hook("tegra_gpio_direction_out failed\r\n");
		return;
	}

	while (1) {
		rtosTaskDelay(5);
		tegra_gpio_set_value(GPIO_CAN_TX, toogle_gpio);
		rtosTaskDelay(GPIO_OUT_SET_DELAY);
		toogle_gpio = !toogle_gpio;
	};
}

void can_force_app_init(void)
{
	rtosTaskParameters gpio_app_task_params = {
		.pvTaskCode = &gpio_app_task,
		.pcTaskName = (char *)"gpioapp",
		.uxPriority = rtosIDLE_PRIORITY,
		.pvParameters = NULL,
		.uxStackDepthBytes = 512,
	};

	int val = rtosTaskCreate(&gpio_app_task_params, NULL);

	if (val != rtosPASS)
		error_hook("xTaskCreate for gpio_app_task failed\r\n");
}

```

Then copied the spe.bin to bootloader/spe\_t194.bin. But I’m not seeing any changes on the line with a multimeter. I disabled mmtcan overlay on dtb and any reference to the gpio on it as well. Lastly I applied the pinmux config suggested on the can example of spe. So im not sure if im missing something.  
I tried flashing it like

- sudo ./flash.sh -k spe-fw jetson-xavier-nx-devkit-emmc mmcblk0p1
- sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

So I’m not sure if I misunderstood the documentation, or what could be happening.

Regards,  
Andres  
Embedded SW Engineer at RidgeRun  
**Contact us:** [support@ridgerun.com](mailto:support@ridgerun.com)  
**Developers wiki:** [https://developer.ridgerun.com](https://developer.ridgerun.com/)  
**Website:** [www.ridgerun.com](http://www.ridgerun.com/)

---

<div class="post-metadata">

**Author:** ![jachen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jachen/32/14043_2.png) [@jachen](https://forums.developer.nvidia.com/u/jachen)\
**Post date:** [March 26, 2024, 12:24am UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/3 "2024-03-26T00:24:07Z")

</div>

Hello, [andres.artavia](https://forums.developer.nvidia.com/u/andres.artavia):  
Xavier NX cannot support ‘a gpio to be up even when the Jetson is powered off’.  
To support such feature, you may need an extra hardware to do that.

For GPIO sample, you can just follow the instructions in rt-aux-cpu-demo/doc/gpio.md. But SPE can only run when the device’s power-on.

br  
ChenJian

---

<div class="post-metadata">

**Author:** ![andres.artavia](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andres.artavia/32/273049_2.png) [@andres.artavia](https://forums.developer.nvidia.com/u/andres.artavia)\
**Post date:** [March 26, 2024, 5:08pm UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/4 "2024-03-26T17:08:46Z")

</div>

Understood, thanks for the clarification.

---

<div class="post-metadata">

**Author:** ![andres.artavia](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andres.artavia/32/273049_2.png) [@andres.artavia](https://forums.developer.nvidia.com/u/andres.artavia)\
**Post date:** [March 26, 2024, 5:19pm UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/5 "2024-03-26T17:19:02Z")

</div>

Also to verify, what’s the behavior of SPE during reboots on the Jetson? Does it goes down as well?

---

<div class="post-metadata">

**Author:** ![jachen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jachen/32/14043_2.png) [@jachen](https://forums.developer.nvidia.com/u/jachen)\
**Post date:** [March 27, 2024, 12:35am UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/6 "2024-03-27T00:35:46Z")

</div>

> Also to verify, what’s the behavior of SPE during reboots on the Jetson? Does it goes down as well?

Yes. SPE firmware will also be re-loaded and re-start when the whole device reboots, just like other components.

br  
ChenJian

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [April 24, 2024, 5:37am UTC](https://forums.developer.nvidia.com/t/spe-configuration-xavier-nx/287293/8 "2024-04-24T05:37:35Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
