Search found 24 matches

by kevinevans
Fri Aug 29, 2025 4:56 pm
Forum: ESP-IDF
Topic: TWAI dual filters doesn't seem to work with 29-bit IDs
Replies: 3
Views: 205

Re: TWAI dual filters doesn't seem to work with 29-bit IDs

For anyone following along at home, there seems to be two independent bugs: (1) twai_make_dual_filter doesn't work correctly for extended IDs, (2) twai_node_config_mask_filter (or a hal function) doesn't seem to work for extended IDs (or maybe dual filters with extended IDs).

My temporary fix is ...
by kevinevans
Thu Aug 28, 2025 8:19 pm
Forum: ESP-IDF
Topic: TWAI dual filters doesn't seem to work with 29-bit IDs
Replies: 3
Views: 205

Re: TWAI dual filters doesn't seem to work with 29-bit IDs

Huh. Maybe I'm really misunderstanding this.

If I do:


id1=id2=0;
mask1=mask2=0xFFFF;

twai_mask_filter_config_t dual_config = twai_make_dual_filter(
id1, mask1,
id2, mask2,
true
);


Doesn't this mean both filters require the IDs to be 0? And this should let no messages through? I'm ...
by kevinevans
Thu Aug 28, 2025 6:20 pm
Forum: ESP-IDF
Topic: TWAI dual filters doesn't seem to work with 29-bit IDs
Replies: 3
Views: 205

TWAI dual filters doesn't seem to work with 29-bit IDs

I'm trying out using the dual filters on TWAI with extended (29 bit) IDs, but I'm having some trouble getting it to actually filter. The docs state using dual filters on 29-bit IDs will only compare the upper 16 bits of the 29-bit identifier.

https://i.imgur.com/O1R0V1N.png
Here are the filters ...
by kevinevans
Wed Aug 27, 2025 9:31 pm
Forum: ESP-IDF
Topic: TWAI changes in v5.5
Replies: 6
Views: 1573

Re: TWAI changes in v5.5

Solved my problem. It seemed to be a timing issue.

I couldn't figure working values out for twai_timing_basic_config_t. Using sp_permill=800/1000 (80%) didn't work at all but doing the same thing with the advanced config worked. Not sure if there's a rounding problem or what.

Anyway, here's the ...
by kevinevans
Wed Aug 27, 2025 8:47 pm
Forum: ESP-IDF
Topic: TWAI changes in v5.5
Replies: 6
Views: 1573

Re: TWAI changes in v5.5

Here's a full example of what I'm experiencing:


#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

#include "esp_err.h"
#include "esp_check.h"
#include "esp_log.h"

#include "esp_twai.h"
#include "esp_twai_onchip.h"

static const char TAG[] = "main";

struct nmea_frame {
uint32_t ...
by kevinevans
Wed Aug 27, 2025 3:17 pm
Forum: ESP-IDF
Topic: TWAI changes in v5.5
Replies: 6
Views: 1573

Re: TWAI changes in v5.5


Haven't noticed any problems with it in 5.5 at 500k, but I'm polling (third party J1939 library I'm using doesn't have a way to push messages to it).

Does polling still work for you?

Maybe you're taking too long in the ISR, try upping the queue length. I had to set mine to 500 to handle firmware ...
by kevinevans
Tue Aug 26, 2025 6:25 pm
Forum: ESP-IDF
Topic: TWAI changes in v5.5
Replies: 6
Views: 1573

TWAI changes in v5.5

Has anybody tried updating their code to use the new TWAI/CAN driver in v5.5? (The changes mentioned here: https://docs.espressif.com/projects/esp-idf/en/v5.5-rc1/esp32c3/migration-guides/release-5.x/5.5/peripherals.html#two-wire-automotive-interface-twai)

I was using the old driver (`twai_driver ...
by kevinevans
Fri May 02, 2025 10:09 pm
Forum: ESP-IDF
Topic: ESP32 S2 ADC monitor doesn't seem to work
Replies: 1
Views: 160

Re: ESP32 S2 ADC monitor doesn't seem to work

For brevity, here's the full file. I'm just calling sense_init while I work out some issues.


#include "sense.h"

#include "esp_adc/adc_cali.h"
#include "esp_adc/adc_cali_scheme.h"
#include "esp_adc/adc_continuous.h"
#include "esp_adc/adc_filter.h"
#include "esp_adc/adc_monitor.h"
#include "esp ...
by kevinevans
Fri May 02, 2025 9:38 pm
Forum: ESP-IDF
Topic: ESP32 S2 ADC monitor doesn't seem to work
Replies: 1
Views: 160

ESP32 S2 ADC monitor doesn't seem to work

I'm trying to get the ADC monitor to work. I'd like to create a monitor when the voltage applied exceeds some threshold. I'm initializing ADC1 CH0 like:


// before this:
// - init calib
// - call adc_continuous_new_handle
// - call adc_continuous_config
// - call adc_continuous_register_event ...

Go to advanced search