Skip to content

Nicla fw optimizations #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2022
Merged

Nicla fw optimizations #45

merged 6 commits into from
May 16, 2022

Conversation

giulcioffi
Copy link
Contributor

@giulcioffi giulcioffi commented Dec 23, 2021

Description

This PR introduces some firmware improvements and optimizations that aim at simplifying the code and improving its stability, in particular when using the Host board + Nicla Sense setup.

The main change is about the usage of the Eslov Int Pin. In the current released libraries, this pin is used not only for synchronization, but also to signal Nicla board that communication over the Eslov interface is going to start. There is, indeed, a change of pinMode for the ESLOV_INT_PIN. The current used mechanism is the following:

  1. At start up the ESLOV_INT_PIN is used as OUTPUT of the Host board and INPUT of Nicla Sense.
  2. This pin is toggled by the Host board to let Nicla know that communication over Eslov interface is going to start.
  3. Then the pinMode is reversed and ESLOV_INT_PIN is driven by Nicla to synchronize communication over Eslov.

This complex mechanism was required because there was not enough stack space to start both Eslov and BLE interface and run their threads.
Now, thanks to the change introduced by PR #375 in ArduinoCore-mbed which frees the slave thread stack size when Wire.end() is called, both Eslov interface and BLE can be activated within the BHY2.begin() function. Then, one of the two will be eventually disabled.
NOTE: this PR cannot be merged before a new release of Nicla core containing the mentioned patch is done!

Other introduced changes:

  • NICLA_STANDALONE option added to NiclaConfig enum. When BHY2.begin(NICLA_STANDALONE) is called, only BoschSensortec is started, while BLEHandler, EslovHandler and DFUManager are NOT started.
  • speed-up in firmware validity check inside the Bootloader
  • reduction or removal of not needed delays.
    About this point, some of them are still needed, in particular when issuing a Wire request from the Host board to Nicla Sense. The synchronization mechanism over ESLOV_INT_PIN ( while(!digitalRead(_eslovIntPin)) {} ) may not be enough here, since the callback on Nicla side may be serviced after a certain delay. Therefore we need to add a delay to avoid that a second request is issued before the first one is handled. A more efficient solution here would have been to start a thread that checks the ESLOV_INT_PIN activity, but this could be done only for Portenta and not for the MKR family.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@giulcioffi giulcioffi requested a review from facchinm December 23, 2021 16:34
@github-actions
Copy link

Memory usage change @ 57529bf

Board flash % RAM for global variables %
arduino:mbed_nicla:nicla_sense 🔺 0 - +1232 0.0 - +0.23 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 💚 -232 - -160 -0.02 - -0.02 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 💚 -232 - -160 -0.03 - -0.02 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 💚 -180 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 💚 -192 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
Click for full report table
Board Arduino_BHY2/examples/App
flash
% Arduino_BHY2/examples/App
RAM for global variables
% Arduino_BHY2/examples/BHYFirmwareUpdate
flash
% Arduino_BHY2/examples/BHYFirmwareUpdate
RAM for global variables
% Arduino_BHY2/examples/Fail_Safe_flasher
flash
% Arduino_BHY2/examples/Fail_Safe_flasher
RAM for global variables
% Arduino_BHY2/examples/ShowSensorList
flash
% Arduino_BHY2/examples/ShowSensorList
RAM for global variables
% Arduino_BHY2/examples/Standalone
flash
% Arduino_BHY2/examples/Standalone
RAM for global variables
% Arduino_BHY2Host/examples/Accelerometer
flash
% Arduino_BHY2Host/examples/Accelerometer
RAM for global variables
% Arduino_BHY2Host/examples/Orientation
flash
% Arduino_BHY2Host/examples/Orientation
RAM for global variables
% Arduino_BHY2Host/examples/Temperature
flash
% Arduino_BHY2Host/examples/Temperature
RAM for global variables
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
flash
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
RAM for global variables
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
flash
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
RAM for global variables
%
arduino:mbed_nicla:nicla_sense 116 0.02 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 1232 0.23 0 0.0 116 0.02 0 0.0
arduino:mbed_portenta:envie_m4 -160 -0.02 0 0.0 -160 -0.02 0 0.0 -168 -0.02 0 0.0 -232 -0.02 0 0.0 -160 -0.02 0 0.0
arduino:mbed_portenta:envie_m7 -232 -0.03 0 0.0 -232 -0.03 0 0.0 -160 -0.02 0 0.0 -168 -0.02 0 0.0 -160 -0.02 0 0.0
arduino:samd:mkrgsm1400 -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
arduino:samd:mkrnb1500 -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
arduino:samd:mkrwan1310 -180 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
arduino:samd:mkrwifi1010 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -192 -0.07 0 0.0
arduino:samd:mkrzero -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
Click for full report CSV
Board,Arduino_BHY2/examples/App<br>flash,%,Arduino_BHY2/examples/App<br>RAM for global variables,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>flash,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>RAM for global variables,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>flash,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>RAM for global variables,%,Arduino_BHY2/examples/ShowSensorList<br>flash,%,Arduino_BHY2/examples/ShowSensorList<br>RAM for global variables,%,Arduino_BHY2/examples/Standalone<br>flash,%,Arduino_BHY2/examples/Standalone<br>RAM for global variables,%,Arduino_BHY2Host/examples/Accelerometer<br>flash,%,Arduino_BHY2Host/examples/Accelerometer<br>RAM for global variables,%,Arduino_BHY2Host/examples/Orientation<br>flash,%,Arduino_BHY2Host/examples/Orientation<br>RAM for global variables,%,Arduino_BHY2Host/examples/Temperature<br>flash,%,Arduino_BHY2Host/examples/Temperature<br>RAM for global variables,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>flash,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>RAM for global variables,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>flash,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>RAM for global variables,%
arduino:mbed_nicla:nicla_sense,116,0.02,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,1232,0.23,0,0.0,116,0.02,0,0.0
arduino:mbed_portenta:envie_m4,,,,,,,,,,,,,,,,,,,,,-160,-0.02,0,0.0,-160,-0.02,0,0.0,-168,-0.02,0,0.0,-232,-0.02,0,0.0,-160,-0.02,0,0.0
arduino:mbed_portenta:envie_m7,,,,,,,,,,,,,,,,,,,,,-232,-0.03,0,0.0,-232,-0.03,0,0.0,-160,-0.02,0,0.0,-168,-0.02,0,0.0,-160,-0.02,0,0.0
arduino:samd:mkrgsm1400,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrnb1500,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwan1310,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-192,-0.07,0,0.0,,,,
arduino:samd:mkrzero,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,

@github-actions
Copy link

Memory usage change @ 4b7631f

Board flash % RAM for global variables %
arduino:mbed_nicla:nicla_sense 🔺 0 - +1296 0.0 - +0.25 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 💚 -232 - -160 -0.02 - -0.02 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 💚 -232 - -160 -0.03 - -0.02 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 💚 -180 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 💚 -192 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 💚 -184 - -180 -0.07 - -0.07 0 - 0 0.0 - 0.0
Click for full report table
Board Arduino_BHY2/examples/App
flash
% Arduino_BHY2/examples/App
RAM for global variables
% Arduino_BHY2/examples/BHYFirmwareUpdate
flash
% Arduino_BHY2/examples/BHYFirmwareUpdate
RAM for global variables
% Arduino_BHY2/examples/Fail_Safe_flasher
flash
% Arduino_BHY2/examples/Fail_Safe_flasher
RAM for global variables
% Arduino_BHY2/examples/ShowSensorList
flash
% Arduino_BHY2/examples/ShowSensorList
RAM for global variables
% Arduino_BHY2/examples/Standalone
flash
% Arduino_BHY2/examples/Standalone
RAM for global variables
% Arduino_BHY2Host/examples/Accelerometer
flash
% Arduino_BHY2Host/examples/Accelerometer
RAM for global variables
% Arduino_BHY2Host/examples/Orientation
flash
% Arduino_BHY2Host/examples/Orientation
RAM for global variables
% Arduino_BHY2Host/examples/Temperature
flash
% Arduino_BHY2Host/examples/Temperature
RAM for global variables
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
flash
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
RAM for global variables
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
flash
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
RAM for global variables
%
arduino:mbed_nicla:nicla_sense 116 0.02 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 1296 0.25 0 0.0 116 0.02 0 0.0
arduino:mbed_portenta:envie_m4 -160 -0.02 0 0.0 -160 -0.02 0 0.0 -168 -0.02 0 0.0 -232 -0.02 0 0.0 -160 -0.02 0 0.0
arduino:mbed_portenta:envie_m7 -232 -0.03 0 0.0 -232 -0.03 0 0.0 -160 -0.02 0 0.0 -168 -0.02 0 0.0 -160 -0.02 0 0.0
arduino:samd:mkrgsm1400 -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
arduino:samd:mkrnb1500 -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
arduino:samd:mkrwan1310 -180 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
arduino:samd:mkrwifi1010 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -192 -0.07 0 0.0
arduino:samd:mkrzero -180 -0.07 0 0.0 -184 -0.07 0 0.0 -184 -0.07 0 0.0
Click for full report CSV
Board,Arduino_BHY2/examples/App<br>flash,%,Arduino_BHY2/examples/App<br>RAM for global variables,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>flash,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>RAM for global variables,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>flash,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>RAM for global variables,%,Arduino_BHY2/examples/ShowSensorList<br>flash,%,Arduino_BHY2/examples/ShowSensorList<br>RAM for global variables,%,Arduino_BHY2/examples/Standalone<br>flash,%,Arduino_BHY2/examples/Standalone<br>RAM for global variables,%,Arduino_BHY2Host/examples/Accelerometer<br>flash,%,Arduino_BHY2Host/examples/Accelerometer<br>RAM for global variables,%,Arduino_BHY2Host/examples/Orientation<br>flash,%,Arduino_BHY2Host/examples/Orientation<br>RAM for global variables,%,Arduino_BHY2Host/examples/Temperature<br>flash,%,Arduino_BHY2Host/examples/Temperature<br>RAM for global variables,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>flash,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>RAM for global variables,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>flash,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>RAM for global variables,%
arduino:mbed_nicla:nicla_sense,116,0.02,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,1296,0.25,0,0.0,116,0.02,0,0.0
arduino:mbed_portenta:envie_m4,,,,,,,,,,,,,,,,,,,,,-160,-0.02,0,0.0,-160,-0.02,0,0.0,-168,-0.02,0,0.0,-232,-0.02,0,0.0,-160,-0.02,0,0.0
arduino:mbed_portenta:envie_m7,,,,,,,,,,,,,,,,,,,,,-232,-0.03,0,0.0,-232,-0.03,0,0.0,-160,-0.02,0,0.0,-168,-0.02,0,0.0,-160,-0.02,0,0.0
arduino:samd:mkrgsm1400,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrnb1500,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwan1310,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-192,-0.07,0,0.0,,,,
arduino:samd:mkrzero,,,,,,,,,,,,,,,,,,,,,-180,-0.07,0,0.0,-184,-0.07,0,0.0,-184,-0.07,0,0.0,,,,,,,,

@per1234 per1234 added the type: enhancement Proposed improvement label Jan 15, 2022
@giulcioffi giulcioffi force-pushed the fw_fixes_and_refactor branch from 4b7631f to e36e7c7 Compare May 16, 2022 13:41
@github-actions
Copy link

Memory usage change @ e36e7c7

Board flash % RAM for global variables %
arduino:mbed_nicla:nicla_sense 🔺 0 - +1420 0.0 - +0.27 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 💚 -232 - -160 -0.03 - -0.02 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 💚 -176 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 💚 -176 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 💚 -176 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 💚 -184 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 💚 -176 - -176 -0.07 - -0.07 0 - 0 0.0 - 0.0
Click for full report table
Board Arduino_BHY2/examples/App
flash
% Arduino_BHY2/examples/App
RAM for global variables
% Arduino_BHY2/examples/BHYFirmwareUpdate
flash
% Arduino_BHY2/examples/BHYFirmwareUpdate
RAM for global variables
% Arduino_BHY2/examples/Fail_Safe_flasher
flash
% Arduino_BHY2/examples/Fail_Safe_flasher
RAM for global variables
% Arduino_BHY2/examples/ReadSensorConfiguration
flash
% Arduino_BHY2/examples/ReadSensorConfiguration
RAM for global variables
% Arduino_BHY2/examples/ShowSensorList
flash
% Arduino_BHY2/examples/ShowSensorList
RAM for global variables
% Arduino_BHY2/examples/Standalone
flash
% Arduino_BHY2/examples/Standalone
RAM for global variables
% Arduino_BHY2Host/examples/Accelerometer
flash
% Arduino_BHY2Host/examples/Accelerometer
RAM for global variables
% Arduino_BHY2Host/examples/Orientation
flash
% Arduino_BHY2Host/examples/Orientation
RAM for global variables
% Arduino_BHY2Host/examples/Temperature
flash
% Arduino_BHY2Host/examples/Temperature
RAM for global variables
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
flash
% Arduino_BHY2Host/examples/Nicla_IoT_Bridge
RAM for global variables
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
flash
% Arduino_BHY2Host/examples/Portenta_BLE_Bridge
RAM for global variables
%
arduino:mbed_nicla:nicla_sense 112 0.02 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 112 0.02 0 0.0 1420 0.27 0 0.0 112 0.02 0 0.0
arduino:mbed_portenta:envie_m7 -232 -0.03 0 0.0 -160 -0.02 0 0.0 -168 -0.02 0 0.0 -232 -0.03 0 0.0 -224 -0.03 0 0.0
arduino:samd:mkrgsm1400 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
arduino:samd:mkrnb1500 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
arduino:samd:mkrwan1310 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
arduino:samd:mkrwifi1010 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0 -184 -0.07 0 0.0
arduino:samd:mkrzero -176 -0.07 0 0.0 -176 -0.07 0 0.0 -176 -0.07 0 0.0
Click for full report CSV
Board,Arduino_BHY2/examples/App<br>flash,%,Arduino_BHY2/examples/App<br>RAM for global variables,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>flash,%,Arduino_BHY2/examples/BHYFirmwareUpdate<br>RAM for global variables,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>flash,%,Arduino_BHY2/examples/Fail_Safe_flasher<br>RAM for global variables,%,Arduino_BHY2/examples/ReadSensorConfiguration<br>flash,%,Arduino_BHY2/examples/ReadSensorConfiguration<br>RAM for global variables,%,Arduino_BHY2/examples/ShowSensorList<br>flash,%,Arduino_BHY2/examples/ShowSensorList<br>RAM for global variables,%,Arduino_BHY2/examples/Standalone<br>flash,%,Arduino_BHY2/examples/Standalone<br>RAM for global variables,%,Arduino_BHY2Host/examples/Accelerometer<br>flash,%,Arduino_BHY2Host/examples/Accelerometer<br>RAM for global variables,%,Arduino_BHY2Host/examples/Orientation<br>flash,%,Arduino_BHY2Host/examples/Orientation<br>RAM for global variables,%,Arduino_BHY2Host/examples/Temperature<br>flash,%,Arduino_BHY2Host/examples/Temperature<br>RAM for global variables,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>flash,%,Arduino_BHY2Host/examples/Nicla_IoT_Bridge<br>RAM for global variables,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>flash,%,Arduino_BHY2Host/examples/Portenta_BLE_Bridge<br>RAM for global variables,%
arduino:mbed_nicla:nicla_sense,112,0.02,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,112,0.02,0,0.0,1420,0.27,0,0.0,112,0.02,0,0.0
arduino:mbed_portenta:envie_m7,,,,,,,,,,,,,,,,,,,,,,,,,-232,-0.03,0,0.0,-160,-0.02,0,0.0,-168,-0.02,0,0.0,-232,-0.03,0,0.0,-224,-0.03,0,0.0
arduino:samd:mkrgsm1400,,,,,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrnb1500,,,,,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwan1310,,,,,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,,,,,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-184,-0.07,0,0.0,,,,
arduino:samd:mkrzero,,,,,,,,,,,,,,,,,,,,,,,,,-176,-0.07,0,0.0,-176,-0.07,0,0.0,-176,-0.07,0,0.0,,,,,,,,

@giulcioffi giulcioffi merged commit ac28721 into main May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants